When using thinkphp to do tags tags, there is a problem, is to get the parameters, but can not find the corresponding results. View the database to see that the data exists. What's the problem?
Call with the shape like http:/www.xxxx.com/tags/index/%e8%87%aa%e5%8a%a8%e9%aa%8c%e8%af%81.html
The parameter is encoded by UrlEncode (), and the UrlDecode () function is used to decode it, and then the query still has no result.
The Test Transformation Code iconv () function is followed by a successful result.
The default encoding of the browser is GB2312, and this item is UTF-8 encoded.
The following is the wrong code and the revised code for everyone to look at:
$kw = $_get[' _url_ '] [' 2 ']; Bad code, parameters that can be obtained on IIS, but the query does not produce results.
$kw = Iconv ("gb2312", "Utf-8", $_get[' _url_ '] [' 2 ']);//encoded, capable of querying the result.
In addition, this method applies only to the IIS environment .
Also note that$_get receive the parameters of the time itself has urldecode transcoding function, do not need to urldecode decoding operation!