Re: addslashes, stripslashes
| From: | Pat Lashley | Date: | Tue, 27 Nov 2001 02:42:46 +0000 |
| Subject: | Re: addslashes, stripslashes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75743@lists.php.net to get a copy of this message | ||
--On Monday, November 26, 2001 04:47:35 PM -0800 Scott Aikin <saikin@hydra.acs.uci.edu> wrote:
I've come across a strange problem working backwards with stripslashes after running addslashes. I take a string like: "\t\4" and run it through addslashes, the result is: \\t\\4 After grabbing this data from the database and running 'stripslashes', the data comes out as: "\t" without the \4, for some reason stripslashes always removes any combination of \ and a number. Does anybody know a way around this or can maybe provide some insight about why this is happening?It probably isn't removing it, it's converting it into an EOT character (0x04). That's pretty standard for most environments that do backslash substitution. It should also convert \48 and \060 into a '0' character. (The first being decimal, the second octal due to the leading zero.) -Pat