How to strip html tags from text in PHP

August 2, 2008 · Print This Article

Recently I faced small problem when working for one of my clients. He stores html tags in database:

<font color="00ff00">Some text</font>

 

I need quick and dirty solution, so I decided to use php function strip_tags()

This function removes all html text leaving only text, this was exactly what I need.

The final code look like this:

$text = strip_tags('Text‘);

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • description
  • Furl
  • Live
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Comments

Got something to say?

You must be logged in to post a comment.