> If a user inputs a date into a form, what function can I use to
validate
> that he put in a valid date?
> I want to use checkdate but that needs the date split up into day,
month
> year.
> Anyone have an easy way of doing this?
You have to specify a date format to your users, or at least assume
Here is a funtion that I use.
A user can enter a date in any of the following ways:
01 01 03
01-01-03
1-1-03
01-1-2003
1-01/03
1/1 03 you get the idea...
This function will standardize the date and make sure it's valid. If invalid it
returns "ERROR"
function fixdate($data){
$aux[0]="";
$aux[1]
Hi Diana,
> If a user inputs a date into a form, what function can I
> use to validate that he put in a valid date?
You can't. Here are two dates in two different formats. Only one is valid.
- 13/04/01
- 13/04/01
Can you spot which is which?
> I want to use checkdate but that needs the da
3 matches
Mail list logo