So that I can change string like I\'ll go back to I'll go
views:
70answers:
3
+2
A:
stripslashes()
Un-quotes a quoted string.
ex.:
$string = "This isn't good";
$string = mysql_escape_string($string);
echo "$string";
produces: This isn\'t good
$string = stripslashes($string);
echo "$string";
produces : This isn't good
kylex
2010-01-05 02:16:09
Just an FYI from the php manual: "If magic_quotes_sybase is on, no backslashes are stripped off but two apostrophes are replaced by one instead."http://php.net/manual/en/function.stripslashes.php
Alex
2010-01-05 02:21:39
Keep in mind that stripslashes() is not aware of the MySQL connection charset. see http://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.html
VolkerK
2010-01-05 02:27:27
Neither is `mysql_escape_string`, which is why `mysql_real_escape_string` should be used instead.
bobince
2010-01-05 02:39:05
A:
No.
It's not really required:
$b=mysql_escape_string($a);
$a still contains the unescaped string.
C.
symcbean
2010-01-05 14:26:41