PHP sample code sharing to get the current date and the day of the month this Monday is

黄舟
Release: 2023-03-07 07:10:02
Original
1635 people have browsed it

This article mainly introduces PHP how to get the current date and the day of the month this Monday is, involving phptimestamp, date conversion and operation related operation skills. Friends in need can refer to the following

This article describes the example of PHP's method of obtaining 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; } ?>
Copy after login

The running result is:

今天是2017-03-28号
这个星期一是2017-03-27号
Copy after login

The above is the detailed content of PHP sample code sharing to get 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!