Jump to content

Birth date regular expression?


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...