protected function checkType($type)
    {
        // If no types to check are defined return true
        if (empty($this->types)) {
            return true;
        }

        // Check input type
        $expression = implode('|', $this->types);
        $valid = preg_match('/^(' . $expression . ')$/', $type);

        return $valid === 1;
    }
protected function checkType($type)
    {
        // If no types to check are defined return true
        if (empty($this->types)) {
            return true;
        }

        // Check input type
        $expression = implode('|', $this->types);
        $valid = preg_match('/^(' . $expression . ')$/', $type);

        return $valid === 1;
    }
protected function checkType ( $ type ) { // If no types to check are defined return true if ( empty ( $ this -> types ) ) { return true ; } // Check input type $ expression = implode ( '|' , $ this -> types ) ; $ valid = preg_match ( '/^(' . $ expression . ')$/' , $ type ) ; return $ valid === 1 ; }
Checks if the given element type is valid for HTML4 and HTML5.

@param string $type The element's type to check.

@return bool True if the type is valid, false otherwise.
Checks if the given element type is valid for HTML4 and HTML5 .