public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
public function hasClass ( $ className ) { if ( $ this -> hasAttribute ( 'class' ) ) { return in_array ( $ className , preg_split ( '/\s+/' , $ this -> getAttribute ( 'class' ) ) ) ; } return false ; }
Checks whether an element has a named CSS class.

@param string $className Name of the class

@return bool
Checks whether an element has a named CSS class .