How does php remove the blank characters submitted by the editor like this: HTMLcode & amp; lt; p & amp; gt; & amp; nbsp; & amp; nbsp; & amp; lt; p & amp; gt; ------ solution ------------------ restore to entity as follows: & lt; p & gt; & amp; how does nbsp php remove the blank characters submitted by the editor?
Blank characters like this:
HTML code
<p> </p>
------ Solution --------------------
The restored object is like this:
, And then replace
------ Solution --------------------
The last answer is wrong and is misled by #2. it should be like this:
PHP code
$ Str = '<p> & nbsp; </p>'; $ result = htmlspecialchars_decode ($ str );
------ Solution --------------------
Discussion
Reference:
The last answer is wrong and is misled by #2. it should be like this:
PHP code
$ Str = '& amp; lt; p & amp; gt; & amp; nbsp; & amp; lt;/p & amp; gt ;';
$ Result = htmlspecialchars_dec ......