下个月15日,只在PHP中使用strtotime


15th of next month with using strtotime only in PHP

我需要使用一个strtotime调用,只使用一个文本字符串参数来检索下个月的第15天。

我尝试了以下参数值:

  • strtotime("下个月15日")
  • strtotime("下个月的第一天+14天")
  • strtotime("下个月的15天")

但没有什么能给我预期的结果。这可行吗?

UPD调用strtotime()中其他函数的解决方案不是我想要的。问题是,我需要字符串函数不是由其他计算组成的,而是字符串文字。这是我的问题与其他乍一看可能相似的问题不同的主要原因。

已编辑

<?php echo strtotime(date('Y', strtotime('+1 month')).'-'.date('m', strtotime('+1 month')).'-15'); ?>

试试这个代码

$d = strtotime("next Month +15 day"); 
echo date("Y-m-d",$d);