You are not actually replacing any value. You forgot to assign the return value of the str_replace
call to the $str
variable. This will do the trick:
<?php
$str = ' “evil curly quotes“ no "good straight quotes"';
$str = str_replace ('“', '"', $str);
echo $str;
// Prints:
// “evil curly quotes“ no "good straight quotes"
?>
edit: Tom D also provided the correct answer in his comment (and did it earlier than me to be fair).