title: How to get walking or driving distance via google maps with php
body: <p>I've worked with google maps before, but when implementing it, I've never found any documentation on how to get the exact distance between 2 given locations via Javascript or PHP.</p>
  
  <p>1) It has to be the exact same distance shown on maps, not that formula that gives you the distance in a straight line from one geopoint to the other.</p>
  
  <p>2) It has to be either PHP or Javascript</p>
  
  <p>3) It has to be Google maps, not virtual earth or anything similar.</p>
  
  <p>Best thing I've come up with is sending a HTTP_GET request to google maps using a long URL with variables, which then returns a 200 code plus the HTML for the website. The distance is in there somewhere, just need to filter.</p>
  
  <p>But that's resources intensive and load heavy.</p>
  
  <p>Does anybody know of a better way?</p>
  
  <p>EDIT: <a href="http://be2.php.net/manual/en/function.http-get.php" rel="nofollow noreferrer">this</a> is the function I'm talking about. The DLL isn't included in the regular zip file for windows, I found it as a part of the WAMPserver software.</p>