相关疑难解决方法(0)

与CURL等效的file_get_contents()?

我试图从这样的URL获取一些JSON数据:

$url = 'http://site.com/search.php?term=search term here';
$result = json_decode ( file_get_contents($url) );
Run Code Online (Sandbox Code Playgroud)

但是,客户端的webhost已allow_url_fopen禁用该设置,因此上面的代码不起作用.

上面这些行的等效代码是什么?基本上,搜索词需要通过$_GETURL 提交.

php curl

10
推荐指数
2
解决办法
9884
查看次数

标签 统计

curl ×1

php ×1