note 23740 added to function.strip-tags

From: Date: Fri, 26 Jul 2002 11:40:21 +0000
Subject: note 23740 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-33600@lists.php.net to get a copy of this message
Hi, Maybe this is useless but here is a code sequence that does the same in PHP: $sStripped = ''; $bInside = false; $iDepth = 0; for ($iStripHtml = 0 ; $iStripHtml<$sLength; $iStripHtml++) { if ($sContent[$iStripHtml] == '<') { $bInside = true; $iDepth++; } if ($sContent[$iStripHtml - 1] == '>' && ! (--$iDepth)) { $bInside = false; } if (!$bInside) { $sStripped .= $sContent[$iStripHtml]; } } $sContent = $sStripped; echo '<hr>'; echo $sContent; Calin Uioreanu php9.com Weblog http://www.php9.com -- http://www.php.net/manual/en/function.strip-tags.php http://master.php.net/manage/user-notes.php?action=edit+23740 http://master.php.net/manage/user-notes.php?action=delete+23740 http://master.php.net/manage/user-notes.php?action=reject+23740

« previous php.notes (#33600) next »