空 P 标签之间无法识别的字符 TinyMCE [英] Unrecognized Character Between Empty P Tags TinyMCE

查看:16
本文介绍了空 P 标签之间无法识别的字符 TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tinyMCE 在空 p 标签之间放什么字符.

What character does tinyMCE put in between empty p tags.

我有以下空 p 标签:

I have the following empty p tags:

<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>

我想删除...但 str_replace 或 preg_replace 无法识别它们.我能做的最好的跟踪问题是标签之间的空格.换句话说,我可以删除

Which I'd like to remove... but they are not recognized by str_replace or preg_replace. The best I could do to track down the issue, is the space between the tags. In other words I can remove the

<p> 

本身或

</p>

...但是当我尝试搜索

... but when I try searching for

<p> </p> 

它没有找到它.

尝试过

&nbsp; 

&#32;

我在网上找到了很多解决方案,但没有一个奏效.似乎有问题的字符(p 标签之间的空格)不同或无法识别.我这样说是因为我尝试了以下内容

I found many solutions online but NONE work. It seems the character in question (the space between the p tags) is different or somehow not recognized. I say this because I tried the following

str_replace(" ", "", $html);

字符串中的所有其他空格都被删除了... EXCEPT 用于 p 标记之间的空格.

All of the other spaces in the string got deleted... EXCEPT for the space between the p tags.

推荐答案

可能是某种类型的非打印 unicode 字符.\s 或者 \pS.

It is probably some non-printing unicode character of some type. \s or maybe \pS.

preg_replace("@<p>[\pZ\pC]*</p>@u", "", $string);

这篇关于空 P 标签之间无法识别的字符 TinyMCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆