public static function hasClass($domElement, $className) {
        $classAttr = $domElement->class;
        $classNames = explode(" ", $classAttr);

        return in_array($className, $classNames);
    }
public static function hasClass($domElement, $className) {
        $classAttr = $domElement->class;
        $classNames = explode(" ", $classAttr);

        return in_array($className, $classNames);
    }
public static function hasClass ( $ domElement , $ className ) { $ classAttr = $ domElement -> class ; $ classNames = explode ( " " , $ classAttr ) ; return in_array ( $ className , $ classNames ) ; }
Detects if DOM Element has some class in class attribute list.

@param DOMElement $domElement DOM Element.
@param string $className Name of the class.
@return boolean TRUE or FALSE, depends on class presence in class attribute
list.
Detects if DOM Element has some class in class attribute list .