PHP: how to Get Chinese garbled characters using the Get variable _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHP uses the Get variable to obtain Chinese garbled characters. As we all know, GET in php cannot deliver Chinese characters, but it is generally garbled, but sometimes we need to deliver Chinese characters, take the latest project "share a collection" of the fire network for example. it is well known that in php, GET cannot deliver Chinese characters, but it is generally garbled, but sometimes we need to deliver Chinese characters, let's take a look at the recent project "share/add to favorites" of the helper's house. I encountered this problem when I wrote the PHP program. after the obtained Chinese titles were passed to the Sina favorites, it becomes garbled.

How can this problem be solved? We:

Normal statement (garbled ):

Copy to ClipboardReference content: [www.bkjia.com] @ $ title_this = $ _ GET ["title"];

Change to the following code (normal ):

Copy to ClipboardReference: [www.bkjia.com] @ $ title_this = iconv ("UTF-8", "gb2312", $ _ GET ["title"]);

After the problem is solved, do not forget to go to the new project-share & add to favorites. Http://www.bkjia.com/res/share/

...

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.