// 百度地图
public function baiduMap($address)
{
$newdata = urlencode($address);
$ak = "1234567890";
$url = "http://api.map.baidu.com/geocoding/v3/?address=".$newdata."&output=json&ak=".$ak."";
$address_data = file_get_contents($url);
$json_data = json_decode($address_data);
$gps = [];
$gps['lng'] = $json_data->result->location->lng;
$gps['lat'] = $json_data->result->location->lat;
return $gps;
}
$ak 秘钥性质,注册创建应用可得