<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$lat = '30,31';
$lng = '120,121';
$from=1;//1 WGS坐标系、2 火星坐标系(谷歌、高德、腾讯等)、3 百度坐标系、4 伪墨卡托坐标系
$to=2;//
$url = "https://api.jisuapi.com/coordconvert/coord2addr?appkey=$appkey&lat=$lat&lng=$lng&from=$from&to=$to";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
echo $result['lat'].' '.$result['lng'].' '.$result['from'].' '.$result['to'].'
';
foreach($result['list'] as $val)
{
echo $val['lat'].','.$val['lng'].'
';
}