如何在PHP中显示日期范围
问题描述:
我只是想知道如何在PHP中回显一系列日期
I was just wondering how you can echo a range of dates in PHP
理想情况下,我希望系统在本周星期三至下周星期三显示
ideally i want the system to display this week wednesday to next week wednesday
例如
17/11/10
至24/11/10
有人能指出我正确的方向吗?
can anyone point me in the right direction?
答
$oBeginDate = new DateTime('last wednesday');
$oEndDate = new DateTime('next wednesday');
echo $oBeginDate->format('d/m/Y') . ' to ' . $oEndDate->format('d/m/Y');