在我的PHP代码中,变量“$ postedDate”中有一个日期。
现在我想在7天,15天,一个月和两个月过去之后获取日期。
我应该使用哪个日期函数?
输出日期格式应为美国格式。
最佳答案
使用strtotime。
$newDate = strtotime('+15 days',$date)
$ newDate现在将是$ date之后的15天。 $ date是Unix时间。
http://uk.php.net/strtotime
关于php - 如何在PHP中使用15天/1个月后的日期?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/828332/