How to remove HTML Tags from string?

Posted by om 15 May, 2009

If your strings have image code, any html code or DIV code you can easily remove using this code.

<?Php
$str = preg_replace("/<.*?>/", "", $str);
?>

Hope this little code will be useful for you.

  • Share/Bookmark
Categories : Easy PHP Tags :

Comments
June 6, 2009

thanx,
this code is really work fine
thanx again , for help

Posted by Devphp
July 8, 2009

Isn’t strip_tags() better/faster?

Posted by Avram
August 21, 2009

Using regular expression you can better control your output.

Posted by om
Leave a comment

(required)

(required)