title: De-code JSON data with PHP
body: <p>I have this PHP code:</p>
  
  <pre><code>&lt;?php
  $json = file_get_contents('https://maps.googleapis.com/maps/api/distancematrix/json?origins=1707%20Sixes%20Rd%20,%20Prince%20Frederick%20,%20MD,%2020678&amp;destinations=2000%20Medical%20Pkwy%20,%20Annapolis%20,%20MD,%2021401&amp;mode=driving&amp;units=imperial');
  
  $details = json_decode($json, TRUE);
  ?&gt;
  </code></pre>
  
  <p>JSON data is as below, stored in $details</p>
  
  <pre><code>{
  "destination_addresses" : [ "Annapolis, MD 21401, USA" ],
  "origin_addresses" : [ "Prince Frederick, MD 20678, USA" ],
  "rows" : [
    {
       "elements" : [
          {
             "distance" : {
                "text" : "37.8 mi",
                "value" : 60775
             },
             "duration" : {
                "text" : "51 mins",
                "value" : 3039
             },
             "status" : "OK"
          }
       ]
    }
  ],
  "status" : "OK"
  }
  </code></pre>
  
  <p>I want to extract "37.8 mi" from it. Can anybody help?</p>