- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$time = strtotime(date('Y-m').'-01');
echo date('Y-m-d',$time);
echo '<br>'.$final = date("Y-m-d", strtotime("-1 month", $time));
echo date('m-01-Y 00:00:00',strtotime('this month')) . '<br/>';
echo date('m-t-Y 12:59:59',strtotime('this month')) . '<br/>';