Home > Backend Development > PHP Tutorial > PHP uses Get variables to obtain Chinese garbled solutions_PHP tutorial

PHP uses Get variables to obtain Chinese garbled solutions_PHP tutorial

WBOY
Release: 2016-07-21 14:55:23
Original
1075 people have browsed it

It is well known that GET in PHP cannot deliver Chinese characters, and the delivered data are usually garbled characters. However, sometimes we need to deliver Chinese characters. Take the recent project "Sharing/Collection" of Bangkejia as an example. The author encountered such a problem when writing a PHP program. After the Chinese title was transferred to Sina Collection, it became garbled.

How to solve this problem? Us:

Normal writing (garbled characters):

Copy to ClipboardLiehuo.Net CodesQuoted content: [www.bkjia.com] @$title_this = $_GET["title"];

Change to the following code (normal):

Copy to ClipboardLiehuo.Net CodesQuoted content: [www.bkjia.com] @$title_this = iconv("UTF-8","gb2312",$_GET["title"]);

Now that the problem has been solved, don’t forget to check out Bangke Home’s new project - Share & Collection. http://www.bkjia.com/res/share/

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364440.htmlTechArticleAs we all know, GET in php cannot be delivered exclusively in Chinese. The passed over text is usually garbled, but sometimes we need to pass it on For Chinese, take Agni.com’s recent project “Share/Collect” as an example...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template