public function hasClass(DOMElement $element, $class)
    {
        // Get current class
        $itemClass = trim($this->attr($element, 'class'));

        // Check if class already exists
        $classes = explode(' ', $itemClass);

        return in_array($class, $classes);
    }
public function hasClass(DOMElement $element, $class)
    {
        // Get current class
        $itemClass = trim($this->attr($element, 'class'));

        // Check if class already exists
        $classes = explode(' ', $itemClass);

        return in_array($class, $classes);
    }
public function hasClass ( DOMElement $ element , $ class ) { // Get current class $ itemClass = trim ( $ this -> attr ( $ element , 'class' ) ) ; // Check if class already exists $ classes = explode ( ' ' , $ itemClass ) ; return in_array ( $ class , $ classes ) ; }
Check if the DOMElement has a class.

@param DOMElement $element The DOMElement to handle.
@param string     $class   The class name.

@return bool
@throws Exception
Check if the DOMElement has a class .