this code not work properly today (30-10-2017). Why?
$i = 0;
$first = strtotime('first day this month');
echo date('n', strtotime("-$i month", $first));
// return 10
$i = 1;
$first = strtotime('first day this month');
echo date('n', strtotime("-$i month", $first));
// return 10 THIS IS BAD!!!!!!
$i = 2;
$first = strtotime('first day this month');
echo date('n', strtotime("-$i month", $first));
// return 8
i want return months before $i
.
this code work properly in past days...