Remove HTML tags using PHP Script

By deptz, Thu. August 16, 2012
Categories: PHP related
Tags: , , ,
201 views

I want to strip all HTML tags from string using PHP. After doing some googling, this is the best way i found.

strip_tags(preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>', $HTMl_TEXT))

Just put the HTML Text Variable, and you’re done. 🙂

Comments