I used strtotime()
to go back to the previous month and always take the last day of the previous month, I used to do this:
$data_teste = date('Y-m-t', strtotime('-1 month'));
And it was going on right up to today (31-10-2018), instead of going back to the 30-09-2018 it showed the day 31-10-2018, apparently the function returns 30 days and not for "the previous month "as I thought she did. Does anyone know a way out of this situation?