Home >Backend Development >PHP Tutorial >帮忙写个方法,关于时间的,该怎么解决

帮忙写个方法,关于时间的,该怎么解决

WBOY
WBOYOriginal
2016-06-13 10:23:47836browse

帮忙写个方法,关于时间的
1,首先取今天的时间(年月日,比如20120517)
2,然后取出上个月(年月,比如201204)
要个无bug的方法
谢谢


------解决方案--------------------
echo "上个月:".date("Y-m-d",strtotime("last month"));

Statement:
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