ShootingBlanks
11-16-2007, 03:24 PM
I'm sorry to bother people here with this, but I'm SOOOO bad with Regular Expressions. I just need a simple one to check if the data entered into a text field is in the date format YYYY-MM-DD. So, I'd need to check:
####-##-##
If anyone could help me finish the code below, I'd really appreciate it!:
if ($_POST) {
// ERROR CHECKING
if ($_POST['due_date'] DOES NOT MATCH THE YYYY-MM-DD FORMAT) {
$error = 'Please make sure that your date is in the format YYYY-MM-DD';
}
}
####-##-##
If anyone could help me finish the code below, I'd really appreciate it!:
if ($_POST) {
// ERROR CHECKING
if ($_POST['due_date'] DOES NOT MATCH THE YYYY-MM-DD FORMAT) {
$error = 'Please make sure that your date is in the format YYYY-MM-DD';
}
}