PHP 获取星期
<?php
function getWeek($time = 0) {
$week_array=array('日', '一', '二', '三', '四', '五', '六'); //先定义一个数组
if ($time) {
return '星期' .$week_array[date('w',$time)];
} else {
return '星期' .$week_array[date('w')];
}
}
echo getWeek();
?>