He visto esta función pero no me sirve no se por qué:
Código:
Alguna ayudita por favor??function check_date($str){ /// dead useful when validating between mysql and php date formats trim($str); if(!preg_match("/^(d){1,4}-(d){1,2}-(d){1,4}+$/i",$str)){ return false; } # check that the date is valid if(preg_match("/^(d){1,4}-(d){1,2}-(d){1,2}+$/i",$str)){ list($year,$month,$day)=explode("-",$str); }elseif(preg_match("/^(d){1,2}-(d){1,2}-(d){1,4}+$/i",$str)){ list($day,$month,$year)=explode("-",$str); } if(!checkdate($month,$day,$year)){ return false; } return true; }
graciasss