1 ???????????//取前三个字符 并转化为ASCII 判断是否为BOM文件 2 ?3 ???????????$charset[1] = substr($result, 0, 1); 4 ????????????$charset[2] = substr($result, 1, 1); 5 ????????????$charset[3] = substr($result, 2, 1); 6 ????????????if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && 7 ????????????????ord($charset[3]) == 191) { 8 ????????????????$result = substr($result, 3); 9 ????????????}10 11 ????????????$json_result ???= json_decode($result,true);
json_decode 解析带BOM头文件错误
原文地址:http://www.cnblogs.com/alin-qu/p/7803273.html