我需要一份本月前 24 个月的清单。这是我的代码:
<?php
$monthbefore1 = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$monthbefore2 = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$monthbefore3 = mktime(0, 0, 0, date("m")-2, date("d"), date("Y"));
$monthbefore4 = mktime(0, 0, 0, date("m")-3, date("d"), date("Y"));
$monthbefore5 = mktime(0, 0, 0, date("m")-4, date("d"), date("Y"));
$monthbefore6 = mktime(0, 0, 0, date("m")-5, date("d"), date("Y"));
$monthbefore7 = mktime(0, 0, 0, date("m")-6, date("d"), date("Y"));
$monthbefore8 = mktime(0, 0, 0, date("m")-7, date("d"), date("Y"));
$monthbefore9 = mktime(0, 0, 0, date("m")-8, date("d"), date("Y"));
$monthbefore10 = mktime(0, 0, 0, date("m")-9, date("d"), date("Y"));
$monthbefore11 = mktime(0, 0, 0, date("m")-10, date("d"), date("Y"));
$monthbefore12 = mktime(0, 0, 0, date("m")-11, date("d"), date("Y"));
$monthbefore13 = mktime(0, 0, 0, date("m")-12, date("d"), date("Y"));
$monthbefore14 = mktime(0, 0, 0, date("m")-13, date("d"), date("Y"));
$monthbefore15 = mktime(0, 0, 0, date("m")-14, date("d"), date("Y"));
$monthbefore16 = mktime(0, 0, 0, date("m")-15, date("d"), date("Y"));
$monthbefore17 = mktime(0, 0, 0, date("m")-16, date("d"), date("Y"));
$monthbefore18 = mktime(0, 0, 0, date("m")-17, date("d"), date("Y"));
$monthbefore19 = mktime(0, 0, 0, date("m")-18, date("d"), date("Y"));
$monthbefore20 = mktime(0, 0, 0, date("m")-19, date("d"), date("Y"));
$monthbefore21 = mktime(0, 0, 0, date("m")-20, date("d"), date("Y"));
$monthbefore22 = mktime(0, 0, 0, date("m")-21, date("d"), date("Y"));
$monthbefore23 = mktime(0, 0, 0, date("m")-22, date("d"), date("Y"));
$monthbefore24 = mktime(0, 0, 0, date("m")-23, date("d"), date("Y"));
echo date("F", $monthbefore24);
echo date("F", $monthbefore23);
echo date("F", $monthbefore22);
echo date("F", $monthbefore21);
echo date("F", $monthbefore20);
echo date("F", $monthbefore19);
echo date("F", $monthbefore18);
echo date("F", $monthbefore17);
echo date("F", $monthbefore16);
echo date("F", $monthbefore14);
echo date("F", $monthbefore13);
echo date("F", $monthbefore12);
echo date("F", $monthbefore11);
echo date("F", $monthbefore10);
echo date("F", $monthbefore9);
echo date("F", $monthbefore8);
echo date("F", $monthbefore7);
echo date("F", $monthbefore6);
echo date("F", $monthbefore5);
echo date("F", $monthbefore4);
echo date("F", $monthbefore3);
echo date("F", $monthbefore2);
echo date("F", $monthbefore1);
?>
为什么结果看起来像这样?*三月三月*四月五月六月七月八月九月十二月一月*三月三月*四月五月六月七月八月九月十月十一月十二月一月