to remove html tags from a string.
| From: | Anil Garg | Date: | Fri, 05 Jul 2002 16:33:08 +0000 |
| Subject: | to remove html tags from a string. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105680@lists.php.net to get a copy of this message | ||
Hi,
How to do whats written in the commented line(//) in the code below:
<?php
$term = ".<B>test</b>";
if(stristr($term,"<") && stristr($term,">") &&
!stristr($term,"<br>") &&
!stristr($term,"<p>") ){
printf("its html tag");
// here i want to remove the html tags from $term and then print
it.(here it should print '.test')
}
else{
printf("not a html tag.");
}
?>
Thanx and regards
anil