标签:
/** * @param string $hisStart * @param string $hisEnd * @param int $range * @param string $format * * @return array */ function createHisRange($hisStart = ‘00:00:00‘, $hisEnd = ‘23:59:59‘, $range = 3600, $format = ‘H:00:00‘) { return array_map(function ($time) use ($format) { return date($format, $time); }, range(strtotime($hisStart), strtotime($hisEnd), $range)); } /** * @param $ymdStart * @param bool $ymdEnd * @param int $range * @param string $format * * @return array */ function createYmdRange($ymdStart, $ymdEnd = true, $range = 86400, $format = ‘Y-m-d‘) { return array_map(function ($time) use ($format) { return date($format, $time); }, range(strtotime($ymdStart), strtotime($ymdEnd), $range)); }
标签:
原文地址:http://www.cnblogs.com/mengfanrong/p/5068143.html