由于某种原因json_decode返回NULL与有效的JSON。json_decode返回null与PHP,NFL API
的JSON位于:http://www.nfl.com/liveupdate/scorestrip/scorestrip.json
我得到的页面(的file_get_contents)的文件内容,然后在其上运行json_decode。
还试用了反胶条b/c的魔术引号。
由于提前, 菲尔
$json = file_get_contents('http://www.nfl.com/liveupdate/scorestrip/scorestrip.json');
var_dump(json_decode($json));
首先检查JSON:'的var_dump($ JSON);' - 它看起来仍然有效? – hakre
@hakre对我来说很不错.. – psarid
如果json坏了,'json_decode'返回NULL。最好再看两遍,放到一些json语法检查器中,应该有一个在线。 **编辑:**我认为[菲尔](http://stackoverflow.com/questions/7072885/json-decode-returns-null-with-php-nfl-api/7072934#7072934)是正确的。 – hakre