Re: addslashes
| From: | Jason Wong | Date: | Sat, 22 Jun 2002 11:19:27 +0000 |
| Subject: | Re: addslashes | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103390@lists.php.net to get a copy of this message | ||
On Saturday 22 June 2002 07:42, Chris Shiflett wrote:
> PHP is probably escaping the single quotes for you:
>
> it's -> it\'s
>
> When addslashes() is applied to this, both the backslash character and
> the single quote are escaped:
>
> \ -> \\
> ' -> \'
>
> The result is what you see:
>
> it\'s -> it\\\'s
>
> If you strip slashes twice, you'll be back to normal.
>
> Chris
>
> >>When I use addslashes to add a back slash to a single quote, it returns 3
> >>back slashes (example: 'it\\\'s'. Is that correct? Am I doing something
> >>wrong?
PHP is probably configured to automatically add the slashes. Look in php.ini
for 'magic_quotes' and set accordingly.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
It isn't easy being the parent of a six-year-old. However, it's a pretty
small
price to pay for having somebody around the house who understands computers.
*/