PHP Code:
function theRealStripTags($string)
{
//while there are tags left to remove
while(strstr($string, '>'))
{
//find position of first carrot
$currentBeg = strpos($string, '<');
//find position of end carrot
$currentEnd = strpos($string, '>');
//find out if there is string before first carrot
//if so save it in $tmpstring
$tmpStringBeg = @substr($string, 0, $currentBeg);
//find out if there is string after last carrot
//if so save it in $tmpStringEnd
$tmpStringEnd = @substr($string, $currentEnd + 1, strlen($string));
//cut the tag from the string
$string = $tmpStringBeg.$tmpStringEnd;
}
return $string;
}
No comments:
Post a Comment