php remove script tag from string code example Example: php remove script tag from string $html = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $html);