jeudi 3 mars 2016

check array in iteration php

my quetions is : how I can check same value while in loop..??
I have data collection like this : 1, 2, 3, 4, 4, 5
I want output like this

for()
1 no
2 no
3 no
4 yes
5 no
}

and I have try like this but not working

 <?php $temp_id = array();?>
for()
if(!in_array($myField,$temp_id)){
no
}else{
yes
}




Aucun commentaire:

Enregistrer un commentaire