正则表达式问题 我想要过滤一些html标签的属性,怎么写正则表达式啊,求举个例子比如只允许有<a href="" title=""> <abbr title=""> 这两个个标签和属性 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <\/?(?:a|abbr)([^>]*?)>这样就可以得到<a href="" title=""> <abbr title=""> 这2个标签 <?php$a = "<cdsf><adsf><a>sdf</a> sd<html>sd</html>";$a = preg_replace('/<\/[^a][^>]*>/i', '', $a);$a = preg_replace('/<[^a][^\s][^>]*>/i', '', $a);$a = preg_replace('/<a[^\s][^>]*>/i', '', $a);echo htmlspecialchars($a); strip_tags($string,'<a>,<abbr>') 请问各位测试这段代码的结果是什么? 高分求救!PHP在linux下编译安装的时候,与mysql的问题。 我想取出本周的数据怎么取呢? 有没好办法让5分钟运行一下sql mysql数据库查询结果的怪问题! 问个关于数组的问题 这句php语句是什么意思? 关闭浏览器时执行PHP动作的问题 小问题!送高分!在线等待! help! 360_safe3.php 请教下这个文件是做什么的 求教字符串变数组的问题
$a = "<cdsf><adsf><a>sdf</a> sd<html>sd</html>";
$a = preg_replace('/<\/[^a][^>]*>/i', '', $a);
$a = preg_replace('/<[^a][^\s][^>]*>/i', '', $a);
$a = preg_replace('/<a[^\s][^>]*>/i', '', $a);
echo htmlspecialchars($a);