当前位置:编程学习 > php >>

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

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

很简单:

 代码如下 复制代码

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

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

补充:Php教程,Php入门 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,