addslashes and stripslashes

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.

=====================================================================

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.