PHP get url Chinese characters garbled solution _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHP get url Chinese characters garbled solution. This article introduces how to use the get method when submitting a form. then, we get garbled characters using get, let's take a look at how to solve this problem. This article introduces how to use the get method when submitting a form. then, we get garbled characters using get, let's take a look at how to solve this problem.

I was going to use it like this.

The code is as follows:

[View region dynamics]

The result is displayed on the list. php page: View [dynamic region of the jurisdiction].

I think the encoding of the Chinese character "state" may conflict with something, so...

I found this solution on the Internet:

Usage:

The code is as follows:

"Charset =" UTF-8 "target =" main "> [view]

Use the following code on the list. php page:

The code is as follows:

$ Plate = urldecode ($ _ GET ['Plate ']);

It won't be garbled and the transmission is not normal.


About the string urlencode (string $ str) function

This function allows you to encode a string and use it in the URL request section. It also allows you to pass variables to the next page.

Example #1 urlencode () Example

The code is as follows:

Echo '';
?>

Example #2 examples of urlencode () and htmlentities ()

The code is as follows:

$ Query_string = 'foo = '. urlencode ($ foo).' & bar = '. urlencode ($ bar );
Echo '';
?>

....

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.