<?php
$str="A width=200 B<table bordercolordark=#ffffff cellpadding=1 width=200 height=12>";
$pattern = "/(<table.*?)\bwidth=[^ ]+\b(.*?>)/";
$str = preg_replace($pattern,'\1\2',$str);
echo htmlspecialchars($str);
?>
$str="A width=200 B<table bordercolordark=#ffffff cellpadding=1 width=200 height=12>";
$pattern = "/(<table.*?)\bwidth=[^ ]+\b(.*?>)/";
$str = preg_replace($pattern,'\1\2',$str);
echo htmlspecialchars($str);
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货