Имеем многомерный массив
$return_data = json_decode($response);
как вывести к примеру Sun 7 Showers ? Что не пробую или не выводит или ошибка. Содержание массива
stdClass Object (
[location] => stdClass Object (
[woeid] => 924584
[city] => Kryvyy Rih
[region] => Dnipropetrovsk Oblast
[country] => Ukraine
[lat] => 47.9063
[long] => 33.394699
[timezone_id] => Europe/Kiev )
[current_observation] => stdClass Object (
[wind] => stdClass Object (
[chill] => 17
[direction] => 35
[speed] => 7 )
[atmosphere] => stdClass Object (
[humidity] => 51
[visibility] => 16.1
[pressure] => 999
[rising] => 0 )
[astronomy] => stdClass Object (
[sunrise] => 6:02 am
[sunset] => 7:33 pm )
[condition] => stdClass Object (
[text] => Showers
[code] => 11
[temperature] => 17 )
[pubDate] => 1555070400 )
[forecasts] => Array (
[0] => stdClass Object (
[day] => Fri
[date] => 1555016400
[low] => 8
[high] => 17
[text] => Showers
[code] => 11 )
[1] => stdClass Object (
[day] => Sat
[date] => 1555102800
[low] => 7
[high] => 17
[text] => Showers
[code] => 11 )
[2] => stdClass Object (
[day] => Sun
[date] => 1555189200
[low] => 7
[high] => 14
[text] => Showers
[code] => 11 )
) )
$return_data = json_decode($response, true);
json_decode
выставить флагtrue
, чтобы была конвертация из объекта в массив.