validations.php
//  and return true or false accordingly.
and return true or false accordingly.
and return true or false accordingly .
function is_date($d)
        {
                if(!preg_match("/^(\d){1,2}[-\/](\d){1,2}[-\/]\d{4}$/",$d,$matches))
                        return -1;
                $T = split("[-/\\]",$d);
                $MON=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
                $M = $T[0];
                $D = $T[1];
                $Y = $T[2];
                return $D>0 && ($D<=$MON[$M] ||        $D==29 && $Y%4==0 && ($Y%100!=0 || $Y%400==0));
        }
function is_date ( $ d ) { if ( ! preg_match ( " /^(\d){1,2}[-\/](\d){1,2}[-\/]\d{4}$/ " , $ d , $ matches ) ) return - 1 ; $ T = split ( " [-/ \\ ] " , $ d ) ; $ MON = array ( 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 ) ; $ M = $ T [ 0 ] ; $ D = $ T [ 1 ] ; $ Y = $ T [ 2 ] ; return $ D > 0 && ( $ D <= $ MON [ $ M ] || $ D == 29 && $ Y % 4 == 0 && ( $ Y % 100 != 0 || $ Y % 400 == 0 ) ) ; }
and return true or false accordingly.
and return true or false accordingly .
//Bad Date Format