I am new to php . Few days back I came up with Add Slashes .
I need to know what it is and How is it used in strings .
Could any one help me ?
Thank you friends
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The addslashes() function returns a string with backslashes in front of predefined characters.
The predefined characters are:
single quote (‘)
double quote (“)
backslash ()
NULL
In this example we will add backslashes to the predefined characters in a string:
The output of the code above will be:
Who’s Kai Jim? This is not safe in a database query.
Who\’s Kai Jim? This is safe in a database query.
You can find a complete PHP documentation in http://www.w3schools.com/php/func_string_addslashes.asp