<?php
$rr='2021-11-01';
for ($i=3; $i>=-3; $i--) {
echo date("Y-m-d",strtotime("-".$i."day",strtotime($rr)));
echo "<br>";
}
注:只要月日的话,"Y-m-d"改成"m-d"即可
?>
<?php
$rr='2021-11-01';
for ($i=3; $i>=-3; $i--) {
echo date("Y-m-d",strtotime("-".$i."day",strtotime($rr)));
echo "<br>";
}
注:只要月日的话,"Y-m-d"改成"m-d"即可
?>