Filtering an address
-
Hi Aurovrata,
I am trying to filter and address which I am retrieving through a cf7 form n order to convert it to a pair of values (LAT. & LONG.).
I do have the function that actually converts address in the couple of values but I am struggling in creatign a couple of filters to actually apply the function.
Could you help me with it?
The above mentioned function is as follows:
function get_lat_long($address){ $address = str_replace(" ", "+", $address); $json = file_get_contents("https://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; }
Kind regards,
Javier
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Filtering an address’ is closed to new replies.