function get_lat_long($address){ $address = str_replace(" ", "+", $address); $json = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false®ion=$region"); $json = json_decode($json); $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'}; $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'}; return $lat.','.$long; } $address = "הרב קוק 3 אשדוד"; //put your address here $latlong = get_lat_long($address); $latlong = explode(',' ,$latlong); $lat = $latlong[0]; //latitude value for mentioned address $long = $latlong[1]; //longitude value for mentioned address echo "Latitude is : ".$lat." and Longitude is : ".$long." for given Address : ".$address;