我有一个关于在 javascript 中使用 json(在 php 中加载)的问题。
我从 API 加载 JSON。有人说我最好用 curl 做到这一点?
我搜索了有关 curl 的信息,但没有找到我需要的信息。这就是我现在所做的:
$url='http://api.urlname.com/api/gateway/call/1.4/getApp?appid=2631';
$str = file_get_contents($url);
$data = json_decode($str);
有人知道我该怎么做吗?
提前致谢!