Php Tutorial: urlencode Chinese encoding and urlencode syntax
Str urlencode ($ string)This function is a convenient part of URL Query when encoding strings. It is used as a convenient way to pass variables to the next page.
I wrote this simple
The principle is to convert the Chinese characters to hexadecimal and according to some rules of string combination, to achieve the encoding and decoding of characters, to ensure the integrity and compatibility of the URL data transmission process,
The principle is to convert Chinese characters into hexadecimal and string combinations according to some rules, to realize character encoding and encoding, to ensure the integrity and compatibility of characters in the process of URL data
in PHP UrlEncode () function is to convert the Chinese into a string encoding, so that does not cause the Chinese URL in the browser open garbled or error problems, let me introduce you in the use of UrlEncode () coding is some specific
Str urlencode ($ string)This function is a convenient part of URL query when encoding strings. It is used as a convenient way to pass variables to the next page.I wrote this simple function to create a GET query URL () from an array:*/Function
In PHP Rawurlencode and Rawurlencode are the characters are encoded, the following I will introduce UrlEncode and rawurlencode the difference, there is a need to understand the friends can refer to.
The purpose of UrlEncode is to encode a string,
The urlencode and rawurlencode functions perform some processing on URLs, but they are different during processing. Especially for some special characters, they are completely different, the following is a detailed example of the two url Processing
Urlencode (PHP4, PHP5) urlencode & nbsp; & mdash; & nbsp; URL string description string & nbsp; urlencode & nbsp; (& nbsp; string & nbsp; $ str & nbsp;) This function allows you to encode a string and use it in the request section of the URL.
(PHP 4,
Some time ago said that they encountered a "URL plus throw error" bug, the cause of this bug is that they use the UrlEncode function in the URL, the function will convert the space into a plus sign, which will cause the URL parsing error, and the
In php, rawurlencode and rawurlencode both encode characters. Next I will introduce the differences between urlencode and rawurlencode. For more information, see.
Urlencode is used to encode a string. replace all non-alphanumeric characters except "-
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.