I assume you are trying to check the number of days in the month so you don't end up with 2-31-2003. It depends on how you are collecting the information. If you are having them fill in three different fields you could try something like this... if($_POST['day'] > date('t', mktime(0,0,0,$_POST['month'],1,$_POST['year'])) { // Too many days } Scott