str_replace oddity
| From: | Kevin Waterson | Date: | Sat, 22 Sep 2007 05:45:07 +0000 |
| Subject: | str_replace oddity | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-262362@lists.php.net to get a copy of this message | ||
I am using str_replace to strip double quotes.
$string = 'This string has "quotes" in it';
$string = str_replace('"', '', $string);
this seems to work, yet when I put the $string into mysql,
it uses backslashes to escape where the quotes were. The
double-quotes are gone, yet it still escapes the 'ghost'
where they were.
I even tried
str_replace(array("\x8c", "\x9c", "'", '"'),
'', $string)
but the ghost remains and mysql continues to escape them.
I check the charsets, and the db is Latin-1 and the sting is ISO-8859-1
Any thoughts on this would be most graciously accepted.
Kind regards
kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."