Problème avec str_replace
Bonjour,
j' ai un problème avec la fonction str_replace elle fonctionne bien sauf quand j'ai le même mot au pluriel sa me remplace même mon title (il et alors afficher a l'écran) et du coup cela case mon lien
Voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| function modifier_motcles($phrase) {
$motCles = array('toast', 'toasts');
$newMotCles = array
('<a href="http://www.google.com/" title="toast">toast</a>',
'<a href="http://www.google.com/" title="toasts">toasts</a>');
$newphrase = str_replace($motCles, $newMotCles, $phrase);
return $newphrase;
} |
Merci pour vos réponses.