Google map API reverse geocoding lookup country -


i want country longitude , latitude user enters.but can't country's using following

$country = $code->results[0]->address_components[6]->long_name; 

because country name comes in

$country1 = $code->results[5]->formatted_address; 

how common code country?

you should checking types of country instead of index before getting long name. highly doubt country in same position addresses.

https://developers.google.com/maps/documentation/geocoding/intro


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -