- var_dump: documentation ( source)
- date: documentation ( source)
<?php
$d = new DateTime('2011-01-15 00:00:00');
$d2 = $d->modify('first day of this month');
echo Date('t', 2);
//$d2 = $d2->modify('last day of this month');
//$d3 = $d2->modify('last day of previous month');
var_dump($d2);