我试图从这样的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 提交.