如何获得上个月和下个月?

BRA*_*AVO 10 php date

$year  = 2010;
$month = 10;
Run Code Online (Sandbox Code Playgroud)

我如何获得上个月2010-09和下个月2010-11

pok*_*oke 18

$date = mktime( 0, 0, 0, $month, 1, $year );
echo strftime( '%B %Y', strtotime( '+1 month', $date ) );
echo strftime( '%B %Y', strtotime( '-1 month', $date ) );
Run Code Online (Sandbox Code Playgroud)