I am using the OpenWeather API. I saved it in $jsonobj
, but don't know how to access weather details. I don't know how []
and {}
differs and what they actually mean.
My code is here:
<?php
$name_of_city = "mathura";
$request = 'http://api.openweathermap.org/data/2.5/weather?APPID=my_key&q='.$name_of_city;
$response = file_get_contents($request);
$jsonobj = json_decode($response,true);
print_r($jsonobj);
?>