str_replace oddity
- From: lists@xxxxxxxxxxx (Kevin Waterson)
- Date: Sat, 22 Sep 2007 15:45:07 +1000
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."
.
- Follow-Ups:
- Re: [PHP] str_replace oddity
- From: Jim Lucas
- Re: [PHP] str_replace oddity
- Prev by Date: Re: [PHP] Page Numbering (To The Unsubscribe Guy)
- Next by Date: Re: [PHP] str_replace oddity
- Previous by thread: Re: [PHP] Access name of variable in $_POST array
- Next by thread: Re: [PHP] str_replace oddity
- Index(es):
Relevant Pages
|