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

2 Responses to “How to strip html tags from text in PHP”

  1. ANTHONY on July 4th, 2010 10:39 am


    Pillspot.org. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. High quality pills. Buy pills online

    Buy:Maxaman.VPXL.Cialis.Viagra Super Active+.Super Active ED Pack.Zithromax.Soma.Propecia.Levitra.Viagra Professional.Viagra Soft Tabs.Cialis Soft Tabs.Cialis Super Active+.Viagra.Cialis Professional.Viagra Super Force.Tramadol….

  2. inch on August 30th, 2010 5:01 am

Got something to say?

You must be logged in to post a comment.