For more information, see

Source: Internet
Author: User
For more information about garbled text, see $ city = $ this-> uri-> segment (4 );
// Var_dump (json_decode ($ city, true ));
// $ City = iconv ("UTF-8", "UTF-8", $ this-> uri-> segment (4 ));
$ City = urldecode ($ this-> uri-> segment (4 ));
Var_dump ($ city );
$ City = iconv ("ISO-8859-1", "GBK", $ city );
Echo $ city;
Echo"
"." 222 ";
Print_r (iconv_get_encoding ());


The page encoding in the current browser is gbk, and the function output is a ISO-8859-1. The original output is % E5 % 8C % 97% E4 % BA % AC.
If the browser is changed to unicode, it will show normal.

Thanks for a while.


Reply to discussion (solution)

Use mb_convert_encoding ??.

Use mb_convert_encoding ??.




Poor

Done

Header ("content-Type: text/html; charset = utf-8 ");

This is a good tutorial.

No webpage code is specified.

$ City = $ this-> uri-> segment (4); this method is too stupid. In addition, cannot the name of this city be represented by an ID?

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.