Removing HTML?
Moderator: General Moderators
Removing HTML?
How would you check each word to see if it bagan with a < and ended with a >, and then remove those words?
strip_tags(); - http://www.php.net/strip_tags
This is a sentence - 18
This is a sentence - 25
This is a sentence - 18
Code: Select all
<?php
$a="This is a sentence";
$b="This <b>is</b> a sentence";
$c=strip_tags($b);
echo $a.' - '.strlen($a).'<BR>'.$b.' - '.strlen($b).'<br>'.$c.' - '.strlen($c)
?>This is a sentence - 25
This is a sentence - 18