remove script tag from HTML content

Because this question is tagged with regex I’m going to answer with poor man’s solution in this situation: $html = preg_replace(‘#<script(.*?)>(.*?)</script>#is’, ”, $html); However, regular expressions are not for parsing HTML/XML, even if you write the perfect expression it will break eventually, it’s not worth it, although, in some cases it’s useful to quickly fix … Read more