GBK编码也能正常显示JSON?
<?php $data = "json data"; $newData = iconv('UTF-8','GBK',$data); echo json_encode($data); echo "</br>"; echo json_encode($newData);
显示结果是:
"json data"
"json data"
而不是
"json data"
null
为什么???
<?php $data = "json data"; $newData = iconv('UTF-8','GBK',$data); echo json_encode($data); echo "</br>"; echo json_encode($newData);
显示结果是:
"json data"
"json data"
而不是
"json data"
null
为什么???
2016-07-10
举报