Xml 从标题中删除html(wordpress)

Xml 从标题中删除html(wordpress),xml,title,Xml,Title,我为产品使用导入插件,产品从xml文件(通过url)导入,一个xml文件的标题中有以下字符串: < product_title > < ![CDATA[ < font color=red >All cities:< /font > Lorem Ipsum is simply dummy text of the printing and typesetting industry. ! ]] > < /product_title > <

我为产品使用导入插件,产品从xml文件(通过url)导入,一个xml文件的标题中有以下字符串:

< product_title >
< ![CDATA[
< font color=red >All cities:< /font > Lorem Ipsum is simply dummy text of the printing and typesetting industry. !
]] >
< /product_title >

< ![CDATA[
所有城市:Lorem Ipsum只是印刷和排版行业的虚拟文本!
]] >

从我的标题中删除此内容的功能是什么:

(按原样显示,没有编码)

非常感谢, 这是可以在PHP中使用的




将成为

<h1 class="page-title"> <?php if (strlen($btp_title) > 160) { $btp_title = substr($btp_title, 0, 160).'...'; } echo strip_tags( esc_html( $btp_title ) ); ?> </h1>


谢谢你的回复,这是我的标题,你能组合一下吗,谢谢@Stathis\u k9我给我的答案添加了一个例子。@Stathis\u k9“不工作”是什么意思?你有错误吗?它的输出不是您想要的吗?你说得太含糊了。@stau k9尝试切换
esc\u html
strip\u标记
函数。我不知道esc_html做什么,WordPress SVN trunk坏了。
<h1 class="page-title"> <?php if (strlen($btp_title) > 160) { $btp_title = substr($btp_title, 0, 160).'...'; } echo esc_html( $btp_title ); ?> </h1>
<h1 class="page-title"> <?php if (strlen($btp_title) > 160) { $btp_title = substr($btp_title, 0, 160).'...'; } echo strip_tags( esc_html( $btp_title ) ); ?> </h1>