Forum Moderators: coopster

Message Too Old, No Replies

str replace weirdness?

         

username

5:31 am on Jun 10, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi, is anyone able to remove this from a string:

$txt = "Blah, blah, blah ‘ ’";
str_replace("’","",$txt);

It just gets ignored?

dreamcatcher

6:53 am on Jun 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to assign the output of str_replace to a new string.

$txt =str_replace("’","",$txt);
echo $txt;

dc