<?php
Class hisRange {
public $s, $e, $r, $f;
function __constructor($s= '00:00:00', $e= '23:59:59', $r= 3600, $f= 'H:00:00') {
$this->s = $s;
$this->e = $e;
$this->r = $r;
$this->f = $f;
}
function run() {
return array_map(array($this, 'fm'), range(strtotime($this->s), strtotime($this->e), $this->r));
}
function fm($t) {
return date($this->f, $t);
}
}
$range = new hisRange();
$s = $range->run();
print_r($s);
preferences:
40.72 ms | 402 KiB | 5 Q