<?php $chaine = 't';$array = array('toto', 'titi', 'JJ', 'Pépé');
if (arrayinstr($string, $array)) echo "Trouvé !";
function arrayinstr($haystack, $needle) { foreach($needle as $value) { if (!strpos($haystack, $value) === false) return true; } return false; } ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<?php $chaine = 't';$array = array('toto', 'titi', 'JJ', 'Pépé');
while($i<$nb) { if (strpos($array[$i], $value)) { echo 'trouvé'; break; } $i++; } ?>