PHP 发送get请求

PHP 发送get请求

file_get_contents 方法:

$s = file_get_contents("http://apis.map.qq.com/ws/distance/v1/?mode=driving&from=30.56808,104.064305&to=30.5702,104.06476&key=your key");
$s = json_decode($s, true);
message($s['result']);

 
原文地址:https://www.cnblogs.com/GetcharZp/p/11858281.html