Home > php教程 > php手册 > php中strtotime给个时间返回该时间所在的星期一

php中strtotime给个时间返回该时间所在的星期一

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:16:01
Original
922 people have browsed it

一个简单的php中strtotime给个时间返回该时间所在的星期一实现代码,有需要的朋友可参考。

strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。

很简单:

 代码如下 复制代码

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

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

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template