How can php use code to convert "garbled text" into Chinese characters, just like the Chinese in the address bar of Baidu? how can I convert such strings into Chinese ??? % E5 % 8C % 97% E4 % BA % AC what functions should I use to convert to Chinese ?? Help me... ------ solution ---------------------- urlencode-encode the URL string to return a string. how can php convert "garbled" to Chinese characters using code?
Just like the Chinese characters in the address bar of Baidu, how can I convert such strings into Chinese ???
% E5 % 8C % 97% E4 % BA % AC what functions should I use to convert to Chinese ?? Help me ....
------ Solution --------------------
Urlencode-encode a URL string
Returns a string -_. all other non-alphanumeric characters will be replaced with a semicolon (%) followed by two hexadecimal numbers, and spaces will be encoded as the plus sign (+ ). This encoding method is the same as that for WWW form POST data and the same as that for application/x-www-form-urlencoded. For historical reasons, this encoding is different from RFC1738 encoding (see rawurlencode () in space encoding as the plus sign (+. This function allows you to encode a string and use it in the request part of a URL. It also allows you to pass variables to the next page:
Echo '';
?>
Urldecode-decode the encoded URL string
Decodes any % # in the encoded string ##. Returns the decoded string.
$ A = explode ('&', $ QUERY_STRING );
$ I = 0;
While ($ I <count ($ )){
$ B = split ('=', $ a [$ I]);
Echo 'Value for parameter ', htmlspecialchars (urldecode ($ B [0]),
'Is, htmlspecialchars (urldecode ($ B [1]),"
\ N ";
$ I ++;
}
?>