Re: quotes in text strings
| From: | Erwin | Date: | Wed, 02 Oct 2002 11:02:22 +0000 |
| Subject: | Re: quotes in text strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118575@lists.php.net to get a copy of this message | ||
Javier Montserat wrote:
> Hi
>
> Single quote's in strings entered via a text input field are
> subsequently appearing with what appears to be an escape character -
>
> comm\'ents
>
> how can i correct this? I've tried
> htmlspecialchars($string, ENT_QUOTES);
> and
> htmlentities($string, ENT_QUOTES);
>
> but these don't seem to work (maybe its me).
Probably you have magic_quotes_gpc set to On in php.ini...you can change
this to Off, or you can use stripslashes() on the $string variable...
HTH Erwin