PHP: Validate Date – Check if A Given Date, Month and Year Combination is Valid or Legal

The simples PHP function that does the job I can think of is checkdate():

if (checkdate(2, 28, 1999)) { // Feb. 28th, 1999
	echo 'valid';
} else {
	echo 'invalid';
}
Scroll to Top