stolzyboy, str_replace does not seem to be picking up the smart quotes in your example (I added a replace string to your example for testing). For example:
$foo = str_replace ("?" , "bar", $foo );
echo $foo;
$foo is not modified. Any ideas? (for some reason Safari is changing the smart quote into ?, but it's present correctly in my code.)
Halfabee, thanks, but I need the smart quotes replaced, rather than escaped.