PHP gets the date of the day-year, month, day and day of the week

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

Guess you like

Origin blog.csdn.net/z3287852/article/details/113662760