php get Get URL Chinese garbled solution _php Tutorial

Source: Internet
Author: User
Tags urlencode
This article is to introduce us when we submit a form if the form uses a Get method, and then we use get to get to the will be garbled, let me see how to solve this problem.

Originally intended to use this

The code is as follows Copy Code

[View Jurisdiction News]

Results are obtained on the list.php page-view [territory dynamic Yiwen]

I think it may be the "state" of the Chinese character this code and some things conflict, so ...

I found an online solution like this:

Use:

The code is as follows Copy Code

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

Then use it on the list.php page

The code is as follows Copy Code

$plate =urldecode ($_get[' plate ');

It will not be garbled and passed out of normal


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 () example

The code is as follows Copy Code

Echo ';
?>

Example #2 UrlEncode () and htmlentities () example

The code is as follows Copy Code

$query _string = ' foo= '. UrlEncode ($foo). ' &bar= '. UrlEncode ($bar);
Echo ';
?>

http://www.bkjia.com/PHPjc/631260.html www.bkjia.com true http://www.bkjia.com/PHPjc/631260.html techarticle This article is to introduce us when we submit a form if the form uses a Get method, and then we use get to get to the will be garbled, let me see how to solve this problem. ...

  • 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.