[ACCEPTED]-How to find the start and end date of a previous month in PHP-php

Accepted answer
Score: 44

I guess this would do

echo date('Y-m-d', strtotime('first day of last month'));

echo "<br/>";

echo date('Y-m-d', strtotime('last day of last month'));


Score: 5
echo date('m-01',strtotime('last month')) . '<br/>';
echo date('m-t',strtotime('last month')) . '<br/>';


More Related questions