regex - php regular expression...weird behavior -
what's wrong in expression?
echo preg_replace("/condizioni/","ciao","<tr bla vla condizioni");
it not return anything...
anyway works when remove "<" char...but don't understand why...is special char, , if i have match literally.
thank you...
it work want (code on ideone). thing echo "<tr bla vla ciao";
in web page cause troubles. have escape html chars.
echo htmlspecialchars(preg_replace("/condizioni/","ciao","<tr bla vla condizioni"));
it echo <tr bla vla ciao
.
Comments
Post a Comment