0
我想僅回顯json的fromatted_address,但不知道如何?下面
代碼:如何從php curl json獲取反向地理編碼
<?PHP
$ch = curl_init();
$url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=22.569794,88.357934';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_HEADER, False);
curl_setopt($ch, CURLOPT_NOBODY, False); //only header
print "<pre>";
$bko = print_r(curl_exec($ch));
print "</pre>";
?>
只需使用'json_decode($ string,true)'將其轉換爲數組 – DevDonkey
嗨,我想回聲「格式化地址」從JSON數組,我已經打印它,我只想回聲格式化地址,請卡住它 –