- var_dump: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$date_teste = date('Y-m-d', strtotime('last day of last month'));
var_dump($date_teste);
$date_teste = new DateTime('last day of last month');
var_dump($date_teste);