- array_push: documentation ( source)
- var_dump: documentation ( source)
- time: documentation ( source)
<?php
$from = time();
$times = array($from, $from+86400, $from+86400+86400+86400, $from+86400+86400+86400+86400+86400+86400);
$days = array();
$countPerDay = 0;
foreach ($times as $time) {
if ($from + 86400 >= $time) {
$countPerDay++;
} else {
$from += 86400;
array_push($days, $countPerDay);
if ($countPerDay != 0) {
$countPerDay = 0;
}
}
}
var_dump($days);