duai0935
2013-05-27 10:08
浏览 307
已采纳

从URL中提取JSON格式的数据

Hi i have been trying to pull data in JSON format. Here is my code

$resourse_url  = 'http://www.livepicly.com/app/api.php?method=list_vendor_name';
$json_data = file_get_contents($resourse_url);
$json_output = json_decode($json_data, TRUE);

$vendor = $json_output['vendor_name'][1];

echo "<pre>";
print_r($vendor);
exit(1);

However when i run the code it does not return anything. When i try to access the source URL via firefox, it asks me where to save the JSON data as *.php, however when i access the source URL from Chrome it displays the JSON data as normal.

What do i have to do here? Can anyone point me to a solution? Thx

1条回答 默认 最新

相关推荐 更多相似问题