protected function _validate($value)
    {
        // Look for Ymd keys?
        if (is_array($value)) {
            $value = $this->_arrayToDate($value);
        }

        // basic date format yyyy-mm-dd
        $expr = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/D';

        return (preg_match($expr, $value, $match) && checkdate($match[2], $match[3], $match[1]));
    }
protected function _validate($value)
    {
        // Look for Ymd keys?
        if (is_array($value)) {
            $value = $this->_arrayToDate($value);
        }

        // basic date format yyyy-mm-dd
        $expr = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/D';

        return (preg_match($expr, $value, $match) && checkdate($match[2], $match[3], $match[1]));
    }
protected function _validate ( $ value ) { // Look for Ymd keys? if ( is_array ( $ value ) ) { $ value = $ this -> _arrayToDate ( $ value ) ; } // basic date format yyyy-mm-dd $ expr = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/D' ; return ( preg_match ( $ expr , $ value , $ match ) && checkdate ( $ match [ 2 ] , $ match [ 3 ] , $ match [ 1 ] ) ) ; }
Validates that a value is an ISO 8601 date string

The format is "yyyy-mm-dd".  Also checks to see that the date
itself is valid (for example, no Feb 30).


@param   scalar  Value to be validated
@return  bool    True when the variable is valid
Validates that a value is an ISO 8601 date string