PHP出现JSON_ENCODE中文乱码的最好的解决方法 feifanPHP2021年4月12日 PHP出现JSON_ENCODE中文乱码的最好的解决方法 <?php $testJSON=array('name'=>'中文字符串','value'=>'test'); //echo json_encode($testJSON); foreach ( $testJSON as $key => $value ) { $testJSON[$key] = urlencode ( $value ); } echo urldecode ( json_encode ( $testJSON ) ); ?> php