title: JSON Weather Feed in PHP
body: <p>I am trying to display this weather information by pulling it from a JSON feed in PHP. I can't figure out why it is not printing. Here is the code:
      
  
  <pre><code>$url="http://api.openweathermap.org/data/2.5/forecast?q=Albany,usl&amp;APPID=5099c5feb579c7a17b030de0d009282f&amp;units=metric";
  $json=file_get_contents($url);
  $data=json_decode($json);
  
  
  
  echo '&lt;h1&gt;', $data-&gt;name, ' (', $data-&gt;sys-&gt;country, ')&lt;/h1&gt;';
  
  // the general information about the weather
  echo '&lt;h2&gt;Temperature:&lt;/h2&gt;';
  echo '&lt;p&gt;&lt;strong&gt;Current:&lt;/strong&gt; ', $data-&gt;main-&gt;temp, '&amp;deg; C&lt;/p&gt;';
  echo '&lt;p&gt;&lt;strong&gt;Min:&lt;/strong&gt; ', $data-&gt;main-&gt;temp_min, '&amp;deg; C&lt;/p&gt;';
  echo '&lt;p&gt;&lt;strong&gt;Max:&lt;/strong&gt; ', $data-&gt;main-&gt;temp_max, '&amp;deg; C&lt;/p&gt;';
  
  ?&gt;
  </code></pre>
  
  <p>My output is something like: </p>
  
  <p>()</p>
  
  <p>Temperature:</p>
  
  <p>Current: ° C</p>
  
  <p>Min: ° C</p>
  
  <p>Max: ° C</p>