remove item from class php code example Example: php remove class attribute $html = preg_replace('/class=".*?"/', '', $html);