如何删除< p>使用php从HTML标记和它的内容 [英] How do I remove <p> tag and its content from HTML using php
本文介绍了如何删除< p>使用php从HTML标记和它的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是我需要从
<p> Addiction, stress and subjective wellbeing</p>
<p> The need and significance of traditional shop lot pavements in the context of town conservation in Malaysia</p>
<p> The role of wage and benefit in engaging employee commitment</p>
我尝试过
$title= preg_replace('#<p>(.*?)</p>#', '', $title['result']);**
但是仍然在获取< p>
标签,有什么想法吗?
But still am Getting <p>
tags, any ideas?
推荐答案
仅需删除p个标签即可
$text=str_ireplace('<p>','',$text);
$text=str_ireplace('</p>','',$text);
这篇关于如何删除< p>使用php从HTML标记和它的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文