Like 20151225 in this format. What method to find out is the day of the week ... The new person asks for advice.
Reply to discussion (solution)
$time = time ();
echo Date (' D ', $time); Day of the week, the text indicates that 3 letters Mon to Sun
echo Date (' L ', $time);//day of the week, full text format Sunday to Saturday
echo Date (' N ', $time),//iso-8601 format digit Day of the week (PHP 5.1.0 new Plus) 1 (for Monday) to 7 (for Sunday)
echo Date (' W ', $time);//day of the week, number represents 0 (representing Sunday) to 6 (for Saturday)
Baidu a search a lot of ....
$time = time ();
echo Date (' D ', $time); Day of the week, the text indicates that 3 letters Mon to Sun
echo Date (' L ', $time);//day of the week, full text format Sunday to Saturday
echo Date (' N ', $time),//iso-8601 format digit Day of the week (PHP 5.1.0 new Plus) 1 (for Monday) to 7 (for Sunday)
echo Date (' W ', $time);//day of the week, number represents 0 (representing Sunday) to 6 (for Saturday)
Baidu a search a lot of ....
Big Brother, you this time is getting the current timestamp .... I asked for a date ... Format like 20151225: And 20151225 is not a timestamp. Brother
You know the date doesn't turn the date into a timestamp, baby?
You know the date doesn't turn the date into a timestamp, baby?
$time = Strtotime ("2015-12-12"); Echo date (' N ', $time);
I thought there was something about the original function. The result is to kill Kung fu ...
Then knot paste.
My way is to make 20151225 of such a string into an array with the Str_split function first. Then manually stitch into the required format. The approximate code is as follows. Hope to be helpful to people in the future.
$str = Str_split ("20151225"); $time = $str [0]. $str [1]. $str [2]. $str [3]. " -". $str [4]. $str [5]." -". $str [6]. $str [7];echo date (" L ", Strtotime (" $time "));