php 日期变下个月五号问题

WBOY
Release: 2016-06-20 12:54:00
Original
935 people have browsed it

$date = '2015-06-14';//怎么写会变成2015-07-05
Copy after login


回复讨论(解决方案)

$date = '2015-06-14';echo date('Y-m',strtotime('+1 month',strtotime($date ))).'-05' ;
Copy after login

观察到 2015-06-14 和 2015-07-05 都是 周日
所以有

$date = '2015-06-14';echo date('Y-m-d', strtotime("3 week $date"));
Copy after login
2015-07-05

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!