What is the best code for PHP to do the same?
I am using;
For this month
<?php $date = date('F'); echo "$date";?>
For 1 month ago
<?php
$mnth = date('F');
$prev_mnth = date('F',strtotime("-1 months")); // "previous month" works also
echo $prev_mnth;
?>
But they are both showing March today
For 2 months ago
<?php
$mnth = date('F');
$prev_mnth = date('F',strtotime("-2 months")); // "previous month" works also
echo $prev_mnth;
?>
But this shows January as expected...