在网上找到一种解决方法:
复制代码 代码如下:
/* 处理json_encode中文乱码 */
$data = array ('game' => '冰火国度', 'name' => '刺之灵', 'country' => '冰霜国', 'level' => 45 );
echo json_encode ( $data );
echo "
";
$newData = array ();
foreach ( $data as $key => $value ) {
$newData [$key] = urlencode ( $value );
}
echo urldecode ( json_encode ( $newData ) );
?>