<?php /** * @param DateTime $date * @return bool */ function firstDayOfMonth(\DateTime $date) { return (int)$date->format('d') <= 7; } $day = new \DateTime('2013/9/2'); var_dump(firstDayOfMonth($day));
You have javascript disabled. You will not be able to edit any code.