I\'m trying to get driving distance between two points using Google Maps API. Now, I have code which get direct distance:
This function get lat and
You can try using Google Distance Matrix API. Here is a sample HTML, PHP code in bellow. Here you must change the 'YOUR_API_KEY' with your app key.
Origin: Destination: Distance: rows[0]->elements[0]->distance->value / 1000).' Km'; ?> Travel Time: rows[0]->elements[0]->duration->text; ?>