tags:

views:

70

answers:

3

So that I can change string like I\'ll go back to I'll go

A: 

stripslashes()

Chacha102
+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
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
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
Neither is `mysql_escape_string`, which is why `mysql_real_escape_string` should be used instead.
bobince
A: 

No.

It's not really required:

$b=mysql_escape_string($a);

$a still contains the unescaped string.

C.

symcbean