- var_dump: documentation ( source)
<?php
/**
* @param DateTime $date
* @return bool
*/
function firstDayOfMonth(\DateTime $date)
{
return (int)$date->format('d') <= 7 && $date->format('l') === 'Monday';
}
$day = new \DateTime('2013/9/2');
var_dump(firstDayOfMonth($day));