str_replace oddity



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."
.



Relevant Pages

  • Re: [PHP] str_replace oddity
    ... it uses backslashes to escape where the quotes were. ... but the ghost remains and mysql continues to escape them. ... is $string honestly something that you are getting via a form submit? ...
    (php.general)
  • Re: [PHP] str_replace oddity
    ... it uses backslashes to escape where the quotes were. ... but the ghost remains and mysql continues to escape them. ... is $string honestly something that you are getting via a form submit? ...
    (php.general)
  • Re: RegExp DoubleQuote
    ... and recieved an error that the quotes don't match. ... Notice that you officially need to escape the as well when you put them in a tag. ... not work and I recieve an error about it being malformed. ... Jesse Houwing ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [PHP] mysql_real_escape_string() question
    ... I was generating a pdf document after the user filled in a form. ... But you *WERE* using MySQL! ... multi-byte/unicode/funky characters for MySQL usage. ... I'm sometimes at a loss how to properly escape ...
    (php.general)
  • Re: A critique of cgi.escape
    ... and quotes should always be escaped. ... Making cgi.escape always escape the '"' character would not break ... and would probably fix a few bugs in existing code. ...
    (comp.lang.python)