我希望将mtgapi返回的数据放入一个关联键和值数组中。
可以在http://mtgapi.com/docs找到示例输出。
当输出作为字符串返回时,我使用file_get_contents($url);
编辑: 我不知道return是一个JSON对象!简单!
答案 0 :(得分:1)
它正在返回一个JSON对象。您应该使用json_decode
。
尝试:
$json = file_get_contents($url);
var_dump(json_decode($json, true));