---
title: "strip_tags "
author: "jackdong"
date: "2010-05-06T22:23:08Z"
tags: []
categories: ["编程语言"]
slug: "strip-tags"
draft: false
lastmod: "2010-05-06T22:23:08Z"
id: 660747
url: "https://dnnta.iteye.com/blog/660747"
---

**strip\_tags**(html)

Strips all HTML tags from the `html`, including comments. This uses the html-scanner tokenizer and so its HTML parsing ability is limited by that of html-scanner.

```
  strip_tags("Strip <i>these</i> tags!")
  # => Strip these tags!

  strip_tags("<b>Bold</b> no more!  <a href='more.html'>See more here</a>...")
  # => Bold no more!  See more here...

  strip_tags("<div id='top-bar'>Welcome to my website!</div>")
  # => Welcome to my website!
```