Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php know if city exist gmap api

   public static function  latlong($location) {

        if ($location!='') {
            try {
                $json = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($location));
                $parsedjson = json_decode($json, true);

                if (key_exists(0,$parsedjson['results'])) {
                    $lat_long_array = $parsedjson['results'][0]['geometry']['location'];
                    return $lat_long_array;
                } else {
                    return false;
                }
            } catch (Exception $e) {
                //echo 'Caught exception: ',  $e->getMessage(), "
";
                return false;
            }
        }


    }
Comment

PREVIOUS NEXT
Code Example
::  
Php :: atom emmet php 
::  
Php ::  
Php ::  
Php :: Delete Collection (Get) 
::  
:: php count avec un tableau bidimentionnel 
Php ::  
Php :: Laravel Http client retry request if fail 
::  
::  
::  
Php ::  
:: Downward half-Pyramid Pattern of Star 
:: how do istart writing a php code 
:: import export csv file in laravel 
::  
::  
Php ::  
Php ::  
Php ::  
:: how to push associative array in php 
:: laravel seeder multiple column 
Php ::  
:: User::factory()-create( 
::  
Java ::  
:: priority queue reverse order java 
::  
ADD CONTENT
Topic
Content
Source link
Name
8+7 =