I am using ereg to validate the format of a date entry (mm/dd/yy), but if
the year ends in a 0, it is being stripped and as such produces an error. So
1990 would be 199.  The dob is being inputted by a form....

Here is my code:

if (!ereg("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", $formsave["dob"], $parts)) {
 $error["dob"] = "*"; $message["dob"] = "Invalid date format!";
 $dob = " \"$parts[3]-$parts[2]-$parts[1]\"";
}

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to