src/Transformatika/Utility/Fn.php
public static function validDateForm($date)
    {
        $isOK = true;
        if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $date)) {
            list($d, $m, $y) = explode("/", $date);
            $month = (int)$m;
            $day   = (int)$d;
            $year  = (int)$y;
            if (!checkdate($month, $day, $year)) {
                $isOK = false;
            }
        } else {
            $isOK = false;
        }
        if ($isOK == false) {
            $date = date('d/m/Y');
        }

        return $date;
    }
public static function validDateForm($date)
    {
        $isOK = true;
        if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $date)) {
            list($d, $m, $y) = explode("/", $date);
            $month = (int)$m;
            $day   = (int)$d;
            $year  = (int)$y;
            if (!checkdate($month, $day, $year)) {
                $isOK = false;
            }
        } else {
            $isOK = false;
        }
        if ($isOK == false) {
            $date = date('d/m/Y');
        }

        return $date;
    }
public static function validDateForm ( $ date ) { $ isOK = true ; if ( preg_match ( "/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/" , $ date ) ) { list ( $ d , $ m , $ y ) = explode ( "/" , $ date ) ; $ month = ( int ) $ m ; $ day = ( int ) $ d ; $ year = ( int ) $ y ; if ( ! checkdate ( $ month , $ day , $ year ) ) { $ isOK = false ; } } else { $ isOK = false ; } if ( $ isOK == false ) { $ date = date ( 'd/m/Y' ) ; } return $ date ; }
Validate Date Form
@param  Date
@return Date
Validate Date Form