Re: replacing literal " in string
| From: | Kevin Stone | Date: | Wed, 25 Sep 2002 15:59:40 +0000 |
| Subject: | Re: replacing literal " in string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117581@lists.php.net to get a copy of this message | ||
Robert,
That str_replace() you wrote should work. But you might also try these
variations..
$key = str_replace('"', '', $key);
$key = str_replace(chr(34), '', $key);
Good luck,
Kevin
----- Original Message -----
From: "ROBERT MCPEAK" <RMCPEAK@jhuccp.org>
To: <php-general@lists.php.net>
Sent: Wednesday, September 25, 2002 7:52 AM
Subject: [PHP] replacing literal " in string
> Could somebody help me with the correct syntax for an ereg_replace to
> replace literal occurences of the quote character in a string. I can't
> seem to get it right.
>
> In other words, I have a form input variable -- that literally may look
> like this: "some_value", and I want it to literally look like this:
> some_value.
>
> I tried:
> $key=str_replace ("\"", "", "$key");
> and other variations but can't get it to work.
>
> What am I missing?
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>