I have fetched the JSON data using the following code.
$json = file_get_contents('http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139');
$data = json_decode($json,true);
print_r($data);
foreach($data as $key => $datas){
$datas[$key];
}
this is the decoded json
Array(
[coord] => Array
(
[lon] => 139
[lat] => 35
)
[sys] => Array
(
[message] => 0.0053
[country] => JP
[sunrise] => 1394571511
[sunset] => 1394614136
)
[weather] => Array
(
[0] => Array
(
[id] => 802
[main] => Clouds
[description] => scattered clouds
[icon] => 03d
)
)
[base] => cmc stations
[main] => Array
(
[temp] => 289.82
[pressure] => 1013
[temp_min] => 289.82
[temp_max] => 289.82
[humidity] => 30
)
[wind] => Array
(
[speed] => 3.08
[gust] => 8.74
[deg] => 230
)
[clouds] => Array
(
[all] => 48
)
[dt] => 1394611401
[id] => 1851632
[name] => Shuzenji
[cod] => 200
)
Then I tried to display the data using the Foreach method, but I couldn't got it right.
Can someone please help me with this.......
foreachcode as well..$jsonshow?