Possible Duplicate:
Date validation in PHP?
date validation for year, month, day each separate.
if date typed in input less of date now (date submit) return false.
hoe are them??
$data_go = '1390/04/28';
$ddmmyyy='([1-9][\d]{3})[- \/.]([0-1][\d])[- \/.]([0-3][\d])';
if(preg_match("/$ddmmyyy$/", $data_go)) {
return TRUE;
}else {
return FALSE;
}
You’ll have to use the optional
$matchesargument frompreg_matchto capture the different regex groups you’ve specified, and then determine individually whether each of them is greater than or equal to today’s date. You can use the various arguments in thedatefunction to return the month, day of month, and year, respectively.