Faqts : Computers : Programming : Languages : PHP : Common Problems : Strings

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

28 of 35 people (80%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can I strip certain HTML tags from a string?

Mar 15th, 2000 18:36
Dave Garth, Nathan Wallace, unknown unknown, Steve Edberg


Check out the Message Filter class at:
    http://px.sklar.com/code.html?code_id=145
You could also use:
  $outStr = strip_tags($inStr); // if you are removing all tags
or you could just use regular expressions to remove specific tags:
  $outStr = ereg_replace("<html>", "", $inStr);
  $outStr .= ereg_replace("</html>", "", $inStr);