public function removeClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (in_array($class, $classes)) {
                $classes = array_diff($classes, [$class]);
            }

            if (empty($classes)) {
                unset($this->attr['class']);
            } else {
                $this->attr['class'] = implode(' ', $classes);
            }
        }
    }
public function removeClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (in_array($class, $classes)) {
                $classes = array_diff($classes, [$class]);
            }

            if (empty($classes)) {
                unset($this->attr['class']);
            } else {
                $this->attr['class'] = implode(' ', $classes);
            }
        }
    }
public function removeClass ( $ class ) { if ( isset ( $ this -> attr [ 'class' ] ) ) { $ classes = explode ( ' ' , $ this -> attr [ 'class' ] ) ; if ( in_array ( $ class , $ classes ) ) { $ classes = array_diff ( $ classes , [ $ class ] ) ; } if ( empty ( $ classes ) ) { unset ( $ this -> attr [ 'class' ] ) ; } else { $ this -> attr [ 'class' ] = implode ( ' ' , $ classes ) ; } } }
Remove class from the "class" attribute.

@param string $class Class to remove
Remove class from the class attribute .