gbk下json_encode,中文返回null的问题
[ 2019-01-18 12:51:54 | 作者: admin ]
p.s. 还是可以先将gbk中文转utf8再使用json_encode函数
阅读全文…
if($charset =="gbk"){
//gbk参数全部转utf8
$_POST = $this->array_iconv($_POST,'utf-8','gbk//IGNORE');
$_GET = $this->array_iconv($_GET,'utf-8','gbk//IGNORE');
//gbk数组转json
$data = array("city"=>"杭州");
$data = $this->array_iconv( $data ,'gbk','utf-8//IGNORE');
...//gbk参数全部转utf8
$_POST = $this->array_iconv($_POST,'utf-8','gbk//IGNORE');
$_GET = $this->array_iconv($_GET,'utf-8','gbk//IGNORE');
//gbk数组转json
$data = array("city"=>"杭州");
$data = $this->array_iconv( $data ,'gbk','utf-8//IGNORE');
阅读全文…
1