- preg_match: documentation ( source)
<?php
$result=FALSE;
$date ="";
$pattern = '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/';
preg_match($pattern, $date, $matches);
if (is_array($matches) AND count($matches) >=1) {
print "Valid Date";
}else{
print "Not Valid Date";
}