解决 ThinkPHP URL 中文乱码问题
将GetcodingBehavior.class.php放入/Lib/Behavior中
/Conf/tags.php 加入 "app_begin" => array("Getcoding"),/**<br>
* $_GET 编码 解决url中文问题<br>
* @author Administrator<br>
*<br>
*/<br>
class GetcodingBehavior extends Behavior{<br>
public function run(&$params) {<br>
<br>
foreach ($_GET as $k=>$v){<br>
if(!is_array($v)){<br>
if (!mb_check_encoding($v, 'utf-8')){<br>
$_GET[$k] = iconv('gbk', 'utf-8', $v);<br>
}<br>
}else{<br>
foreach ($_GET['_URL_'] as $key=>$value){<br>
if (!mb_check_encoding($value, 'utf-8')){<br>
$_GET['_URL_'][$key] = iconv('gbk', 'utf-8', $value);<br>
}<br>
}<br>
}<br>
}<br>
<br>
}<br>
}
AD:真正免费,域名+虚机+企业邮箱=0元