public static function stripHtml($value, $tags = null, $keepContent = false)
    {
        $content = '';
        if(!is_array($tags)) {
            $tags = (strpos($value, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
            if(end($tags) == '') array_pop($tags);
        }
        foreach($tags as $tag) {
            if (!$keepContent)
                 $content = '(.+</'.$tag.'[^>]*>|)';
             $value = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $value);
        }
        return $value;
    }
public static function stripHtml($value, $tags = null, $keepContent = false)
    {
        $content = '';
        if(!is_array($tags)) {
            $tags = (strpos($value, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
            if(end($tags) == '') array_pop($tags);
        }
        foreach($tags as $tag) {
            if (!$keepContent)
                 $content = '(.+</'.$tag.'[^>]*>|)';
             $value = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $value);
        }
        return $value;
    }
public static function stripHtml ( $ value , $ tags = null , $ keepContent = false ) { $ content = '' ; if ( ! is_array ( $ tags ) ) { $ tags = ( strpos ( $ value , '>' ) !== false ? explode ( '>' , str_replace ( '<' , '' , $ tags ) ) : array ( $ tags ) ) ; if ( end ( $ tags ) == '' ) array_pop ( $ tags ) ; } foreach ( $ tags as $ tag ) { if ( ! $ keepContent ) $ content = '(.+</' . $ tag . '[^>]*>|)' ; $ value = preg_replace ( '#</?' . $ tag . '[^>]*>' . $ content . '#is' , '' , $ value ) ; } return $ value ; }
Strips a string of HTML tags specified, can strip content or just remove tags

@param string $value       Html/text to strip html from
@param string $tags        Comma separated list of tags to strip (ie "<object>,<script>")
@param bool   $keepContent Keep content within html tags (defaults to false)

@return string
@static
@see http://us.php.net/manual/en/function.strip-tags.php#96483
Strips a string of HTML tags specified can strip content or just remove tags