
在做项目时需要做一个元素的过期时间,之前做过过期的天数相加时间,这次要直接加月数的,顺便就把所有php日期相加来整理一下吧,其实在php中,日期相加也是一件很简单的事情。
当前时间增加一天: eccho date('Y-m-d',strtotime("+1 day"))
当前时间增加一月: strtotime("+1 month")
当前时间增加一年: strtotime("+1 year")
当前时间增加一秒: strtotime("+1 seconds")
已有时间增加一天:
$d='2012-1...