Google Map API..
I want shortest path between two addresses.
Below is my code for it.
Its working fine but it returns unnecessary information thats why url request takes too much time to get response.
$source = "ClinRad Diagnostics & Research Centre, 725, CMH Road, Near CMH Hospital, Indiranagar 1st stage, Bengaluru, Karnataka 560038";
$destination = "HENNUR POLICE STATION, Balachandra Layout, Babusabpalya, Hennur Gardens, Bengaluru, Karnataka 560043";
$url ='http://maps.googleapis.com/maps/api/directions/json?origin='.urlencode($source).'&destination='.urlencode($destination).'&alternatives=true&sensor=false&mode=driving';
$data = file_get_contents($url);
$response = json_decode($data);
echo "<pre>";
print_r($response);
Reponse array details: https://jsfiddle.net/mbb5Lu32/
I want only km value for the shortest path.. Rest of the things are waste for me..
How can I get that specific information using google map API?