Trucs
public php v1 · immutable for ($k = 0; $k < $nbr_mots; $k++) { for ($j = 0; $j < $nbr_nom; $j++) { if (strtolower($nom[$j]) == strtolower($mots[$k])) { $mots[$k] = $mots[$k] . ' est interdit.'; } } $texte .= $mots[$k] . ' '; }$n = count($mots);for ($k = 0; $k < $n; $k++) {$mot = $mots[$k];if(stripos($chaine,$mot)) str_replace($mot,"$mot est interdit.",$chaine);}// ou alors :foreach($mots as $mot) { while(stripos($chaine,$mot)) str_replace($mot,"$mot est interdit.",$chaine); }