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