Jump to content

date validation


phpretard

Recommended Posts

I am trying to vslidate a date format to this - MM-DD-YYY

 

The catch is that the date is submitted like this:

 

<input name='LICEXP[$i]' value='$LICEXP[$i]'>

 

There can be up to 4 dates.

 

Here's my current code:

 

$LICEXP=$_POST['LICEXP'];


	if (!ereg ("([0-9]{2})-([0-9]{2})-([0-9]{4})", $LICEXP)) {
	echo"error";
	}

 

It just echo error for erthang?

 

Any help...

 

I have searched but can't find.  So here I am.

 

Link to comment
https://forums.phpfreaks.com/topic/123833-date-validation/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.