title: Error "Message: Trying to get property of non-object" when trying to retrieve an array
body: <p>I am trying to request some data using json and the wunderground API.</p>
  
  <p>When I use this code it returns the error "Message: Trying to get property of non-object".</p>
  
  <pre><code>&lt;?php
  
    $json_string = file_get_contents("http://api.wunderground.com/api/1e6a89f0a3aa092d/alerts/q/zmw:00000.1.16172.json");
    $parsed_json = json_decode($json_string);
    $wColor = $parsed_json-&gt;{'alerts'}-&gt;{'attribution'};
    $wName = $parsed_json-&gt;{'alerts'}-&gt;{'wtype_meteoalarm'};
    echo "Severe weather alert ${wColor} expected ${wName} - MORE INFO";
  
  ?&gt;
  </code></pre>
  
  <p>The Data is there and can be viewed here...</p>
  
  <p><a href="http://api.wunderground.com/api/1e6a89f0a3aa092d/alerts/q/zmw:00000.1.16172.json" rel="nofollow">http://api.wunderground.com/api/1e6a89f0a3aa092d/alerts/q/zmw:00000.1.16172.json</a></p>
  
  <p>Yet when I use the almost identical example code snippet from the documentation</p>
  
  <pre><code>&lt;?php
    $json_string = file_get_contents("http://api.wunderground.com/api/1e6a89f0a3aa092d/geolookup/conditions/q/IA/Cedar_Rapids.json");
    $parsed_json = json_decode($json_string);
    $location = $parsed_json-&gt;{'location'}-&gt;{'city'};
    $temp_f = $parsed_json-&gt;{'current_observation'}-&gt;{'temp_f'};
    echo "Current temperature in ${location} is: ${temp_f}\n";
  ?&gt; 
  </code></pre>
  
  <p>It works absolutely fine!  How come I the first request fails to work?</p>