How to use PHP addslashes() Function
Programming | PHP | Saturday, 28 January 2012 18:01
How to use PHP addslashes () Function
The addslashes() function returns a string with backslashes in front of predefined characters. PHP runs addslashes() on all GET, POST, and COOKIE data by default. Therefore you should not use addslashes() on strings that have already been escaped, this will cause double escaping. The function get_magic_quotes_gpc() can be used to check this.
This function can be used to prepare a string for storage in a database and database queries.
The predefined characters are:
- single quote (')
- double quote (")
- backslash (\)
- NULL
Syntax
Parameter
String is a required field
Problem
Solution
| |
|
|
| |






