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