title: How can I access the name value in nested JSON using PHP?
body: <p>JSON:</p>
  
  <pre><code>{"location":{"name":"Tirana","region":"Tirane","country":"Albania","lat":41.33,"lon":19.82,"tz_id":"Europe/Tirane","localtime_epoch":1484543668,"localtime":"2017-01-16 5:14"},"current":{"last_updated_epoch":1484543668,"last_updated":"2017-01-16 05:14","temp_c":4.0,"temp_f":39.2,"is_day":0,"condition":{"text":"Overcast","icon":"//cdn.apixu.com/weather/64x64/night/122.png","code":1009},"wind_mph":6.9,"wind_kph":11.2,"wind_degree":150,"wind_dir":"SSE","pressure_mb":1009.0,"pressure_in":30.3,"precip_mm":0.0,"precip_in":0.0,"humidity":60,"cloud":0,"feelslike_c":1.2,"feelslike_f":34.2}}
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>$response = file_get_contents('http://api.apixu.com/v1/current.json?key=a54959ce2b294134bda34330171601&amp;q=Paris');
  var_dump(json_decode($response)); 
  echo $response-&gt;location[0]-&gt;name; 
  </code></pre>
  
  <p>API Call: <a href="http://api.apixu.com/v1/current.json?key=a54959ce2b294134bda34330171601&amp;q=Tirana" rel="nofollow noreferrer">http://api.apixu.com/v1/current.json?key=a54959ce2b294134bda34330171601&amp;q=Tirana</a></p>