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?