I have two fields in a table, one is city and other is address. I have to find whether address lies inside city or not. How can i find this.
for fetching lat and lng of city
$city_lat_lng =json_decode(file_get_contents("http://maps.google.com/maps/api/geocode/json?address={$ogl_city}&sensor=false"));
$city_lat = $city_lat_lng->results[0]->geometry->location->lat;
$city_long = $city_lat_lng->results[0]->geometry->location->lng;
for fetching lat and lng of address
$address_lat_lng = json_decode(file_get_contents("http://maps.google.com/maps/api/geocode/json?address={$ogl_address}&sensor=false"));
$address_lat = $address_lat_lng->results[0]->geometry->location->lat;
$address_long = $address_lat_lng->results[0]->geometry->location->lng;
In the above code, we are able to find lat long of both address and city. But don't get any proper idea of how to find whether a particular address lies inside a specific city. Both city and address dynamic here. I am new in Laravel. searched on google also but not get any proper solutions.