note 46101 added to function.strip-tags
| From: | at dada | Date: | Wed, 29 Sep 2004 12:41:56 +0000 |
| Subject: | note 46101 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77563@lists.php.net to get a copy of this message | ||
if you only want to have the text within the tags, you can use this function:
function showtextintags($text)
{
$text = preg_replace("/(\<script)(.*?)(script>)/si", "dada",
"$text");
$text = strip_tags($text);
$text = str_replace("<!--", "<!--", $text);
$text = preg_replace("/(\<)(.*?)(--\>)/mi",
"".nl2br("\\2")."", $text);
return $text;
}
it will show all the text without tags and (!!!) without javascripts
----
Manual Page -- http://www.php.net/manual/en/function.strip-tags.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46101
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46101&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46101&report=yes
Search -- http://master.php.net/manage/user-notes.php