title: Parse Results of Google Elevation Using PHP
body: <p>I'm new to JSON and parsing.  I get the following results when requesting an elevation from the Google Elevation API.</p>
  
  <pre><code>{
    "status": "OK",
    "results": [ {
      "location": {
        "lat": 39.7391536,
        "lng": -104.9847034
      },
      "elevation": 1608.8402100
    } ]
  }
  </code></pre>
  
  <p>When parsing, I don't know how to effectively reference the elevation using the json_decode results. My abridged code is below:</p>
  
  <pre><code>$json_string = file_get_contents($url);
  $parsed_json = json_decode($json_string);
  $geoElevation = $parsed_json-&gt;{'elevation'};
  </code></pre>
  
  <p>Can anyone tell me why I can't access the "elevation" value using the above?</p>