【发布时间】:2012-01-05 19:00:05
【问题描述】:
json 网址: http://www.nseindia.com/homepage/Indices1.json
每当我直接在浏览器的地址栏中执行此链接时,我都能获得 json 输出。
当我尝试使用 php file_get_contents() 或使用 curl 时,我无法从另一个共享服务器上我的网站上的 php 文件中的上述 url 检索 json 输出。
使用 curl 我得到以下响应:
访问被拒绝 您无权访问此服务器上的“http://www.nseindia.com/homepage/Indices1.json”。
我需要在我的应用程序中使用 php 解码该 json 数据。
【问题讨论】:
-
询问源文件的提供者?
标签: php json parsing curl file-get-contents