<?php
function getWeek($time = 0) {
$week_array=array('日', '一', '二', '三', '四', '五', '六'); //先定义一个数组
if ($time) {
return '星期' .$week_array[date('w',$time)];
} else {
return '星期' .$week_array[date('w')];
}
}
echo getWeek();
?>
转载于:https://www.cnblogs.com/jiqing9006/p/11202100.html