Home  >  Article  >  Backend Development  >  How to convert text with html tags into plain text in php

How to convert text with html tags into plain text in php

WBOY
WBOYOriginal
2016-11-30 23:59:581641browse

Tag phphtml

Such as the following text
How to convert text with html tags into plain text in php

Reply content:

preg_replace regular replacement
http://www.jb51.net/article/27706.htm

<code> <?php $s="<a>aaaa<b>bbbbb</b><font color="red">cc</font>";
echo $s."<br>";
$s= preg_replace("/]+>/is", "", $s);
echo $s;
?>
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn