, UrlDecode () and Rawurldecode () decoding the string is UTF-8 format encoding, if the URL contains Chinese words, and the page set is not UTF-8, then the decoded string to be converted to normal display
PHP Tutorial Chinese URL codec detailed description
In PHP, UrlEncode and Rawurlencode are encoded in Chinese.
String UrlEncode (String str)
Returns a string, in addition to-_, in this string. All non-alphanumeric characters are replaced with a percent (%) followed by a two-digit hexadecimal number. This is the encoding described in RFC 1738 to protect the literal characters from being interpreted as a special URL delimiter, while protecting the URL format from being confused by the transfer of media (like some messaging systems) using character conversions
*/
$a = '? a= Chinese ';
$urlencode =urlencode ($a);
Echo $urlencode; %3FA%3D%D6%D0%CE%C4
/*
String Rawurldecode (String str)
Returns a string that is replaced by a sequence of percent semicolons (%) followed by a two-digit hexadecimal number in this string.
*/
$c = Rawurlencode ($urlencode);///a%253d%25d6%25d0%25ce%25c4;
Echo $c;
/*
One thing to note is that UrlDecode () and Rawurldecode () decode the string is utf-8 format encoding, if the URL contains Chinese words, and the page set is not Utf-8, then the decoded string to be converted to normal display
http://www.bkjia.com/PHPjc/632353.html www.bkjia.com true http://www.bkjia.com/PHPjc/632353.html techarticle , UrlDecode () and Rawurldecode () decode the string is encoded in UTF-8 format, if the URL contains Chinese words, and the page settings are not UTF-8, then to be decoded out of the string ...