Saturday, July 14, 2012

Remove HTML Tags from string in PHP

If your strings have any html code, you can easily remove using following code.

Using regular expression:

<?php
/* 
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/

$string = preg_replace("/<.*?>/", "", $string_contain_html_code);


?>

No comments:

Post a Comment