Re: How is this possible???? (addslashes)
| From: | Nisse Engström | Date: | Fri, 18 Feb 2011 06:20:40 +0000 |
| Subject: | Re: How is this possible???? (addslashes) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311420@lists.php.net to get a copy of this message | ||
On Thu, 17 Feb 2011 06:56:33 +0700, "Paul S" wrote:
> Can anyone please tell me how the addslashes output ("note = Everyone''s a
> card on the \earth") in the following example is possible. It is
> "addslashes" output but this result is consistent with the output from
> "post" when runtime is set: 1): a single quote is inserted before a single
> quote and nothing is added before " or \.
...
> <?php
> $note = "Everyone's a card on the \earth";
> echo "<br>$note<br>";
> $note = addslashes($note);
> echo "<br>note = $note<br>";
> ?>
...
> output:
>
> Everyone's a card on the \earth
>
> note = Everyone''s a card on the \earth
<http://se.php.net/manual/en/function.addslashes.php>
"Having the PHP directive magic_quotes_sybase set to on
will mean ' is instead escaped with another '."
Both "\e" and "\\e" produces the same output.
/Nisse