Here is a Simple Function to check whether a given date is valid or not.
function
is_valid_date($value, $separator='-')
{
if(strlen($value) <= 10)
{
//
check date
$arr=explode($separator,$value);
$day=$arr[2];
$month=$arr[1];
$year=$arr[0];
if(@checkdate($month,
$day, $year))
return
true;
}
return false;
}
No comments:
Post a Comment