时间:2021-07-01 10:21:17 帮助过:31人阅读
header("Content-type:text/html;charset=utf-8");
$url = "http://218.22.201.163/wic/api.php/early_warning/xcyjservice/U/administrator/P/wic/jw/118.589036,30.055954";
$postUrl = str_replace(' ', '%20', $url);
$param = '';
$curlPost = $param;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$data = curl_exec($ch);
curl_close($ch);
//var_dump($data);die;//
var_dump(json_decode($data, true));