php using get Get URL Chinese characters garbled solution, Geturl
In this paper, we describe a workaround for PHP to get the URL of Chinese characters garbled by using get. Share to everyone for your reference. Here's how:
First, the question:
Originally intended to use this
Copy the Code code as follows: [View jurisdiction dynamic]
Results are obtained on the list.php page-view [territory dynamic Yiwen]
At first it may be that the "state" of the Chinese character is in conflict with something, so garbled.
Second, the solution:
Use:
Copy the code as follows: "charset=" Utf-8 "target=" main ">[view]
Then use it on the list.php page
Copy the Code code as follows:
<?php
Header ("content-type:text/html; Charset=utf-8 ");
if ($_get[' plate ')
echo $plate =urldecode ($_get[' plate ');
?>
It will not be garbled and the transmission is not normal.
Note Here the receive Get page encoding needs to be consistent with the sending side!
About the string UrlEncode (string $str) function
This function makes it easy to encode a string and use it for the request part of the URL, and it also facilitates the passing of a variable to the next page.
Example 1 UrlEncode ()
Copy the Code code as follows: <?php
Echo ';
?>
Example 2 UrlEncode () and Htmlentities ()
Copy the Code code as follows: <?php
$query _string = ' foo= '. UrlEncode ($foo). ' &bar= '. UrlEncode ($bar);
Echo ';
?>
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/910585.html www.bkjia.com true http://www.bkjia.com/PHPjc/910585.html techarticle php using get get URL Chinese characters garbled solution, Geturl This article describes the PHP use get get URL Chinese characters garbled solution. Share to everyone for your reference. Specific Party ...