function vkProcedure(s,e,c){
let t
let r = []
let i = 0
while (i <= e) {
if(i%c === 0) {
if(t) { r.push(t) }
t = []
}
t.push(s+i++)
}
if(t) { r.push(t) }
return r
}
<?php
$data = json_decode('{"cod":"200","message":0.0021,"cnt":1,"list":[{"dt":1533135600,"main":{"temp":27.88,"temp_min":26.74,"temp_max":27.88,"pressure":1017.51,"sea_level":1036.77,"grnd_level":1017.51,"humidity":53,"temp_kf":1.13},"weather":[{"id":800,"main":"Clear","description":"ясно","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.97,"deg":19.0015},"sys":{"pod":"d"},"dt_txt":"2018-08-01 15:00:00"}],"city":{"id":524901,"name":"Moscow","coord":{"lat":55.7507,"lon":37.6177},"country":"RU","population":1000000}}');
?>
<?php foreach($data->list as $list): ?>
<?= $list->main->temp ?> Значение выводит
<?php foreach($list->weather as $l): ?>
<?= $l->icon ?> Значение невыводит
<?php endforeach; ?>
<?php endforeach; ?>
echo '<script>alert("TEST! {'
. implode(",\\n", array_map(
function ($k, $v) {
return "'$k': '$v'";
}, array_keys($_POST), $_POST
)
) . '}");</script>';
<?php
session_start();
echo '<pre>';
if (isset($_SESSION['logged_user'])) {
echo 'Сессия существует для isset'.PHP_EOL;
} elseif (array_key_exists('logged_user', $_SESSION)) {
echo 'Сессия существует для array_key_exists'.PHP_EOL;
} else {
$_SESSION['logged_user'] = null;
echo 'Сессия не существует'.PHP_EOL;
}
echo 'Session Id:'.session_id().'</pre>';