标签:分组 group each visit creat lis else 浏览记录 cti
/* 浏览记录按日期分组 */
function groupVisit($visit)
{
$curyear = date(‘Y‘);
$visit_list = [];
foreach ($visit as $v) {
if ($curyear == date(‘Y‘, $v[‘create_time‘])) {
$date = date(‘m月d日‘, $v[‘create_time‘]);
} else {
$date = date(‘Y年m月d日‘, $v[‘create_time‘]);
}
$visit_list[$date][] = $v;
}
return $visit_list;
}
标签:分组 group each visit creat lis else 浏览记录 cti
原文地址:https://www.cnblogs.com/ForAll-I-Care/p/13159970.html