Php 如何在日期变量中连接特定月份?

Php 如何在日期变量中连接特定月份?,php,Php,我需要使用实际年份的月份,类似这样的 $mid = new DateTime('YYYY-07-01'); // this is where should work the actual year echo $mid->modify('second monday')->format('Y-m-d'); 调用date获取当前年份 $mid = new DateTime(date('Y') . '-07-01');

我需要使用实际年份的月份,类似这样的

$mid = new DateTime('YYYY-07-01'); // this is where should work the actual year

echo $mid->modify('second monday')->format('Y-m-d');

调用
date
获取当前年份

$mid = new DateTime(date('Y') . '-07-01');