Jump to content

Birth date regular expression?


grippat

Recommended Posts

hey,Im kinda new to PHP, but I think this solution should work:

$validation = explode("-", 1969-12-01)if (strlen($validation[0]) != 4 ) {	print("Invalid Year Format");}elseif (($validation[1] < 0) || ($validation[1] > 12)) {	print ("Invalid Month Format");}elseif (($validation[2] < 0) || ($validation > 31)) {	print("Invalid Day Format");}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...