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