Getting the First and Last Day of a Month in PHP


Calculate the first and last day of the current month.

Source Code

$firstDay = date('Y-m-01');
$lastDay = date('Y-m-t');
echo "First Day: $firstDaynLast Day: $lastDay";
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments