『壹』 php 删除指定标签的 指定属性 正则表达式

正则么
$name="item rdf:about=\"http://dx.doi.org/10.1038/jes.2014.5\" 21212121 item rdf:about=\"http://dx.doi.org/10.1038/jes.2014.5\" ";
echo $name ."<br>";
$str=preg_replace('/rdf:about=\"([\s\S]*?)\"/',"rdf:about=\"\"",$name);
echo $str;

『贰』 PHP里面,怎么去除提交上来的html标签。

你的这个抄问题有点模糊..
你说的意思是.我在FCK里输入一段<p>1</p> 你要求显示内容的时候是1.而不是<p>111</p>...这种情况..FCK本身提供了原码的输入方式,而当你没有采用原码的形式的时候..也就是普通模式.那么FCK会将你输入的内容转换成HTML实体来显示..显示出来后的结果就是<p>111</p>...
还有另一种解决方法..
strtr($str,array_filp(get_html_translation_table(HTML_ENTITIES)));
这样..它就将已经转换成文本内容再次转换成HTML.

如果你说的是这种情况.那么我建议你不要用FCK了.因为你本身就是想输入HTML代码的....如果用FCK.他就会帮你转换成实体....如果你只是利用了一般的TEXTAREA..就可以直接输入HTML..最后不进行任何处理就可以得到你说的那个效果...

『叁』 php如何移除xml标签下所有的标签

<?
$str='<config>
<syncinfo username="admin">
<iconv>
<item name="xxx" index="xx" />
<item name="xxx" index="xx" />
<item name="xxx" index="xx" />
</iconv>
</syncinfo>
</config>'
$name='iconv'
$tag1="<$name>";
$tag2="</$name>";
$p1=strpos($str,$tag1);
$p2=strpos($str,$tag2);
$str1=substr($str,$p1+strlen($tag1),$p2-$p1-strlen($tag1));
echo str_replace($str1,"",$str);
?>

『肆』 PHP怎么使用正则去除字符串中带有某个class的标签

<?php

$str='<ulid="Lb_show">
<listyle="float:left;width:100%;"class="clone">
<imgsrc="/banner5.jpg">
</li>
<listyle="float:left;width:70%;">
<imgsrc="/banner1.png">
</li>
<listyle="float:left;width:60%;"class="clone">
<imgsrc="/banner1.png">
</li>
<listyle="float:left;width:30%;">
<imgsrc="/banner1.png">
</li>
<listyle="float:left;width:50%;"class="clone">
<imgsrc="/banner5.jpg">
</li>
</ul>';

$str=preg_replace('~<li.*?class="clone"[sS]*?</li>~','',$str);

echo$str;

『伍』 php 如何删除特定标签

数据库信息里边有html标签吗?如果是去掉所有html标签 那就用strip_tags函数,如果去除特定的所有标签 那么就那就用正则了,,自己写罗 假设几种情况 一是像img的 一个像a的假设为imgpreg_replace("/<img[^>]*\/>/","",$str);假设为a那么就是preg_replace(“/<a[^>]*>.*<\/a>/","",$str);

『陆』 怎么去除php页面中的HTML标签啊

|//去掉html标签
$string = preg_replace ( "/(\<[^\<]*\>|\r|\n|\s|\[.+?\])/is", ' ', $string );
//转义html标签
$string = htmlspecialchars ( $string );

『柒』 php利用正则表达式删除html标签

php正则来表达式:<em>.*</em>

完整的源php利用正则表达式删除html标签程序如下:

<?php

$str='<p>12345<em>123abc"def"</em></p>';

echopreg_replace('#<em>.*</em>#is','',$str);

?>

运行结果:

<p>12345</p>

『捌』 php 用正则表达式,去除A标签

$str = '<a href="ddd">ddddd</a>';
echo preg_replace(''/\>\><a.+?>A<\/a>/'','',$str);
这个必须要>>否则会失效。