- var_dump: documentation ( source)
<?php
/**
* Check if a given date is the first Monday of the month
*
* @param \DateTime $date
* @return bool
*/
function isFirstSundayOfMonth(DateTime $date) {
return (int)$date->format('d') <= 7 && $date->format('l') === 'Sunday';
}
$day = new DateTime();
var_dump(isFirstMondayayOfMonth($day));