note 60501 added to function.strpos
| From: | msandersen at ttpg dot com dot au | Date: | Mon, 09 Jan 2006 14:15:14 +0000 |
| Subject: | note 60501 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101451@lists.php.net to get a copy of this message | ||
<?PHP
$txt = preg_replace("|(<script.+</script>)|Usi", "", $txt);
?>
No point in keeping empty script tags. Ungreedy will prevent overzealous content removal where there
are more than one set of script tags on the page. Multiline has no use here.
Otherwise, if you absolutely must have the empty tags:
<?PHP
$txt = preg_replace("|<script[^>]*>(.+)</script>|Usi", "", $txt);
?>
Martin
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60501
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60501&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60501&report=yes
Search -- http://master.php.net/manage/user-notes.php