First and last day of the month in PHP

I’ve been working with dates today and i’ve found a pretty neat snippet to show the first and the last day of the month using php

		$firstDoM = date("Y-m-01"); //01 -> first day of month
		$lastDoM = date("Y-m-t"); //t -> last day of month

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.