1. Addslashes ()Addslashes () escapes special characters in SQL statements, including ('), ("), (), (NUL) four characters, which are used when the DBMS does not have its own escape function, but if the DBMS has its own escape function, it is
WString urlencode ( string $str )Returns a string in which all non-alphanumeric characters except -_ are replaced with a percent sign (%) followed by a two-digit hexadecimal number, and a space is encoded as a plus (+). This encoding is the same as
Addslashes: String add Slash.
Bin2Hex: The binary turns into 16 carry.
Chop: Remove continuous blank.
CHR: Returns the character of the ordinal value.
Chunk_split: Splits the string into small segments.
Convert_cyr_string: Converts the ancient
Htmlspecialchars (), Htmlspecialchars_decode ()
Definition and usage
The Htmlspecialchars () function converts some pre-defined characters to HTML entities.
The predefined characters are:& (and number) becomes &"(double quotes) becomes"' (single
PHP and HTML
PHP and HTML can interoperate: PHP generates HTML, and HTML can pass information to PHP. 1. How do I encode/decode when I use a form/url to pass a value? 2. I'm using
tag, but $foo. x and $foo. Y variables are not available. Where are
There are a lot of string functions in PHP Oh, it is said that PHP is composed of functions, which allows developers to speed up the development of the site Oh, well, crap don't say much. Let's take a look at my friends for free PHP string function
This article mainly introduces the commonly used escape functions, security functions in PHP, use these functions can filter most common attack means, such as SQL injection, the need for friends can refer to the
1. addslashes
Addslashes escapes
Htmlspecialchars (), htmlspecialchars_decode ()
Definition and usage
The htmlspecialchars () function converts some predefined characters into HTML objects.
The predefined characters are:& (And number) becomes & amp;"(Double quotation marks) into &
PHP and HTML
PHP and HTML can interoperate: PHP can generate HTML, while HTML can transmit information to PhP. 1. How can I encode/decode the code when I use a form/URL to transmit values? 2. I am marking with , but the $ Foo. X and $ Foo. Y
PHP and HTMLPHP and HTML can interoperate: PHP can generate HTML, while HTML can transmit information to PHP. 1. How can I encode/decode the code when I use a form/URL to transmit values? 2. I am marking with , but the $ foo. x and $ foo. y
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.