- var_dump: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$dateLastMonth = date("Y-m-d", strtotime("first day of last month"));
$dateCurrentMonth = date("Y-m-d", strtotime("last day of last month"));
var_dump($dateLastMonth, $dateCurrentMonth);