code show as below:
<?php
function getNow(){
$data = [];
$format='Y.m.d';
for ($i=0; $i<1; $i++){
$strtotime = strtotime( '+' .$i.' days');
$data[$i]['date'] = date($format ,$strtotime);
$data[$i]['week'] = "星期" . mb_substr( "日一二三四五六",date("w" ,$strtotime),1,"utf-8" );
}
return $data;
}
var_dump(getNow());
?>
The effect is as follows:
Reference from: https://www.cnblogs.com/bluealine/p/10243144.html