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

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

WBOY
Release: 2016-06-13 13:33:01
Original
825 people have browsed it

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

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<p>    </p>

Copy after login


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

   

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

PHP code

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

引用:

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

PHP code

$str = '&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;';
$result = htmlspecialchars_dec……
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template