<?
/*
* 查询附近加油站
*/
$appkey = 'your_appkey_here';//你的appkey
$lat = '30.2812129803'; //纬度
$lng = '120.11523398'; //经度
$distance = '10000'; //距离
$url = "https://api.jisuapi.com/oilstation/nearby?lat=$lat&lng=$lng&distance=$distance&appkey=$appkey";
$result = curlOpen($url);
$jsonarr = json_decode($result, true);
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach ($result as $val)
{
echo $val['name'].' '.$val['location']['lat'].' '.$val['location']['lng'].' '.$val['address'].' '.$val['province'].' '.$val['city'].' '.$val['area'].' '.$val['telephone'].' '.$val['distance'].' '.$val['price']['oil89'].' '.$val['price']['oil92'].' '.$val['price']['oil95'].' '.$val['price']['oil98'].' '.$val['price']['oil10'].' '.$val['price']['oil90'].' '.$val['price']['oil93'].' '.$val['price']['oil97'].' '.$val['price']['updatetime'].'
';
}
?>