from html to Plain Text


I have a html page saved in MySql DataBase and i want to show that page inside another page but not with html tags.

Did Yii provide any simple functions to do that.

Thank you in advance

Is this what you’re after?

using that function :


$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';

echo strip_tags($text);

echo "\n";

// Allow <p> and <a>

echo strip_tags($text, '<p><a>');


the result is :

Test paragraph. Other text

but i need like below :

You copied the example from the PHP docs and I think that this is a bit misleading. They just show the tags in the example to make them VISIBLE. The result isn’t escaped, so if you just echo it it will be treated as html by the browser