Home>Article>Backend Development> PHP method to obtain the current date and the day of the month this Monday is
This article mainly introduces the method of PHP to obtain the current date and the day of the month this Monday is, involving PHP timestamp, date conversion and operation related operation skills. Friends in need can refer to the following
The example in this article describes how PHP obtains the current date and the day of the month this Monday is. Share it with everyone for your reference, the details are as follows:
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期一': $var=time(); $var2=$var; echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期二': $var=time(); $var2=$var-84600; echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期三': $var=time(); $var2=$var-(84600*2); echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期四': $var=time(); $var2=$var-(84600*3); echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期五': $var=time(); $var2=$var-(84600*4); echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; case '星期六': $var=time(); $var2=$var-(84600*5); echo "今天是".date("Y-m-d",$var)."号
这个星期一是".date("Y-m-d",$var2)."号"; break; } ?>
The running result is:
今天是2017-03-28号 这个星期一是2017-03-27号
The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
PHP method for calculatingdateinterval days
A brief talk about Bootstrap’s DatePickerDateRange selection
##
The above is the detailed content of PHP method to obtain the current date and the day of the month this Monday is. For more information, please follow other related articles on the PHP Chinese website!