我使用当前函数来解析 json 文件:
function getRemoteJson($uri, $decode=true, $noob=false){
if($uri){
$fp = fopen($uri, "r");
$json = trim(file_get_contents($fp));
fclose($fp);
if($decode) return json_decode($json, true);
else return $json;
}
else return false;
}
这个文件很好用: http ://webcast-a.live.sportingpulse.com/matches/3886/09/18/90/33S64Il4cTaxQ/data.json
但是当我使用那个时,它返回 null : http ://webcast-a.live.sportingpulse.com/matches/3886/09/18/94/84Q4GEVlZs4rg/data.json
解析此文件时没有错误代码(即 json_last_error() 返回 JSON_ERROR_NONE )
当我使用在线工具检查格式时,文件被解析......
谢谢,如果你有任何线索