美文网首页
php5.6之后使用file_get_contents(): S

php5.6之后使用file_get_contents(): S

作者: zero风来 | 来源:发表于2017-08-21 11:15 被阅读0次

这个报错的解决方法也是在网上找到了一个不错的解决方法,那就是如下图:

$arrContextOptions=array("ssl"=>array("verify_peer"=>false,"verify_peer_name"=>false,),);

$response=file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidatesStreet=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json",false,stream_context_create($arrContextOptions));

echo $response;

?>

那就是在使用file_get_contents()方法之前添加一个数组参数,然后就在这个方法里面给它添加上这个参数,然后你就能发现不会报错啦~~

相关文章

网友评论

      本文标题:php5.6之后使用file_get_contents(): S

      本文链接:https://www.haomeiwen.com/subject/xwdcdxtx.html