Source Code:
(back to article)
<?php $date = date('Y-m-d'); $prev_month = date('m-Y', strtotime("-1 month", strtotime($date))); echo "Current month: " . date('m-Y') . "\n"; echo "Previous month: " . $prev_month . "\n";
Result:
Report an issue