我有文本文件中的数据,我加载到数组行明智,但最近我已经注意到,当“μ”进入数据然后json_encode重试空白响应,并且当我从数据中删除“μ”然后json_encode函数工作php json_encode错误补丁
我有PHP版本5.5.3
$dat = array("0"=>"hello","1"=>"world");
echo json_encode($dat); // work
$data = array("0"=>"hello","1"=>"180.00 10µH");
echo json_encode($data); // blank response ..
我搜索GitHub的PHP页面上json_enocde功能,但其所有的C,
所以任何想法如何修补这个功能
哦.....你是对的。 –
尝试'JSON_ERROR_CTRL_CHAR'选项' –
试试这个:http://stackoverflow.com/questions/6606713/json-encode-non-utf-8-strings – barudo