In php, strtotime gives a time and returns the Monday where the time is_PHP Tutorial

WBOY
Release: 2016-07-13 17:14:56
Original
866 people have browsed it

A simple implementation code for strtotime in PHP to return the Monday when the time is located. Friends in need can refer to it. The

strtotime() function parses any English text datetime description into a Unix timestamp.

It’s simple:

The code is as follows
 代码如下 复制代码

echo strtotime('-1 Mon',strtotime("2010-01-01"));//返回日期所在时间的星期一

echo strtotime('Mon',strtotime("2010-01-01"));//返回日期所在时间的下一个星期一的时间

Copy code
echo strtotime('-1 Mon',strtotime("2010-01-01"));//Return the Monday of the date and time

echo strtotime('Mon',strtotime("2010-01-01"));//Returns the time on the next Monday after the date and time

http://www.bkjia.com/PHPjc/628896.htmlwww.bkjia.com
true
http: //www.bkjia.com/PHPjc/628896.html
TechArticleA simple php strtotime gives a time and returns the Monday where the time is located. Friends who need it can implement the code. refer to. The strtotime() function decodes the date and time description of any English text...
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!