Home >Backend Development >PHP Tutorial >php 如何去除编辑器提交的空白字符

php 如何去除编辑器提交的空白字符

WBOY
WBOYOriginal
2016-06-13 10:20:34923browse

php 怎么去除编辑器提交的空白字符
就像这样的空白字符:

HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><p>    </p>


------解决方案--------------------
还原为实体是这样:

   

,再替换 
------解决方案--------------------
上个回答错了,被#2误导了,应该这样:

PHP code
$str = '<p>    </p>';$result = htmlspecialchars_decode($str);<br><font color="#e78608">------解决方案--------------------</font><br>
探讨

引用:

上个回答错了,被#2误导了,应该这样:

PHP code

$str = '&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;';
$result = htmlspecialchars_dec……
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