Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

HTML tag stripper (See related posts)

// *UNTESTED*
// Strips complete and incomplete HTML tags from $html

function strip_bad_tags($html)
{
   $s = preg_replace ("@]*>*@", "", $html);
   return $s;
}

Comments on this post

climaxdesigns posts on Sep 07, 2006 at 16:57
I saw this code on some site and used it, and it works prefectly with such things as user comments. i use it to strip the tags out such as anchors and what not.

You need to create an account or log in to post comments to this site.


Related Posts