note 31021 added to function.strpos
| From: | wodzuY2k at interia dot pl | Date: | Mon, 07 Apr 2003 08:31:24 +0000 |
| Subject: | note 31021 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46301@lists.php.net to get a copy of this message | ||
//this loop removes <script>.*</script> tags from HTML contents.
while(true)
{
$begPos = strpos($contents,"<script");
if ($begPos===false) break; //all tags were found & replaced.
$endPos = strpos($contents,"script>",$begPos+strlen("<script"));
$tmp = substr($contents,0,$begPos);
$tmp .= substr($contents,$endPos+strlen("script>"));
$contents = $tmp;
if ($loopcontrol++>100) break; //loop infinity control
continue; //search again
};
--
http://www.php.net/manual/en/function.strpos.php
http://master.php.net/manage/user-notes.php?action=edit+31021
http://master.php.net/manage/user-notes.php?action=delete+31021
http://master.php.net/manage/user-notes.php?action=reject+31021