In PHP we often use stripslashes and addslashes, let me explain in detail the stripslashes and addslashes use of the difference between them.
Addslashes
The Addslashes () function adds a backslash before the specified predefined character.
These
In php, we often use stripslashes and addslashes. next I will introduce the differences between stripslashes and addslashes in detail. The addslashes and addslashes () functions add a backslash before the specified predefined characters.
In php, we
From: http://www.jb51.net/article/49205.htm This article mainly introduces the differences between PHP functions Addslashes and Mysql_real_escape_string, and an Introduction to SQL injection vulnerability, A friend you need can refer to the
In php, we often use stripslashes and addslashes. Next I will introduce the differences between stripslashes and addslashes in detail.
Addslashes
The addslashes () function adds a backslash before the specified predefined character.
The predefined
Php mysql_real_escape_string addslashes and mysql bind parameters to prevent SQL injection attacks and realescapestring
Php mysql_real_escape_string addslashes and mysql bind parameters to prevent SQL injection attacks
Php has three methods to
Addslashes
(PHP 4, PHP 5, PHP 7)
Addslashes-quote string with slashes
addslashes-referencing strings with backslashes
Descriptionaddslashes($str)// Returns a string with backslashes added before characters that
Differences between phpstripslashes and addslashes. This article mainly introduces the differences between phpstripslashes and addslashes. When we write data to mysql, for example, the code is as follows: mysql_query (update this article mainly
First: Do not use mysql_escape_string, it has been deprecated, please use mysql_real_escape_string instead of it.
The difference between mysql_real_escape_string and addslashes is:Difference One:Addslashes does not know anything about the MySQL
First, do not use mysql_escape_string. It has been discarded. Use mysql_real_escape_string instead.
The difference between mysql_real_escape_string and addslashes is:Difference 1:Addslashes does not know any character set related to MySQL
: This article mainly introduces addslashes and other methods for clearing spaces, which are insecure. For more information about PHP tutorials, see. The space clearing method is insecure, in part because there are many spaces in the characters. for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.