addslashes and stripslashes
addslashes:
========
addslashes
It quote a special characters that need to be quoted in database queries in a string preceded with slashes.
These characters are single quote (’), double quote (”), backslash (\) and NUL (the NULL byte) etc.
Syntax:
=====
string addslashes ( string str)
stripslashes:
========
stripslashes
It un-quote string that quoted with addslashes() .
It returns a string with backslashes stripped off. (\’ becomes ‘ and so on.) Double backslashes are made into a single backslash.
Syntax:
=====
string stripslashes ( string str)
Example:
=======
$str = “your’s”;
echo $str = addslashes($str);
The Output is
your\’s
Now this will be passed as a input to stripslashes,
stripslashes($str);
Now the output is your’s.
=====================================================================
