In the PHP language, string escaping and anti-escaping can be achieved using the own functions addslashes() and stripslashes() provided by PHP. 1. addslashes() function The addslashes() function is used to add a backslash (\) to the specified string string. The syntax format is as follows: addslashes(string); Description: Returns a string with backslashes added in front of certain characters for the purpose of database query statements, etc. These characters are single quotes ('), double quotes ("), backslash (\) and NUL (NULL character). 2. stripslashes() function The stripslashes() function is used to add backslashes ( \) Delete and return to the original. The syntax format is as follows: stripslashes(string); Earlier we introduced what PHP escapes and anti-escapes string data, introduced the escape character "\", and how to use the transfer character to string Convert
1. Detailed explanation of PHP escape and anti-escape string functions
Introduction: In PHP, string escaping and anti-escaping can also be achieved using the addslashes() function and stripslashes() function provided by PHP.
2. What is php escaping and escaping string data?
Introduction: Escape characters, as the name implies, will use "\" to output the specified syntax. However, the syntax stipulates that the escape characters have different functions in different systems. For example: the carriage return and line feed character under Windows use "\r" or "\". n ", and Linux has a big difference between the two: "\r" the cursor returns to the beginning of the line, but is still on the same line; "\n" means the next line, and will not return to the beginning of the line.
Introduction: PHP anti-escaping problem
4. Which master of mysql escape function can give me a
##Introduction: mysql transfer Who can give me a PHP mysql escape function? It seems that I need to reverse the escape function when querying. Please enlighten me! Symbols like <> should be able to be converted, right? mysql escape
5.
mysql escape function Which expert can give me a
Introduction: mysql escape Who can give me a PHP mysql function? Who can give me a PHP mysql escape function? It seems that I need to reverse the escape function when querying. Please enlighten me! Symbols such as <> should be able to be converted.The above is the detailed content of PHP anti-escaping example usage summary. For more information, please follow other related articles on the PHP Chinese website!