header("Content-Type: text/html; charset=utf-8"); if(is_array($_POST) && isset($_POST['content'] )){ $source_content = $content=$_POST['content']; function delHtmlTag ($str) { $preg ="/\s*[^=\s+]+\s*=\s*([^=>]+)?(?=(\s+|>))/i"; //去除所有的标签属性 $preg = "/(style|id|class|bgcolor|width|height|background)=\s*([^=>]+)?(?=(\s+|>))/i";//去除某些特定的标签属性 $str = preg_replace($preg, "", $str); $preg = "/(style|id|class|bgcolor|width|height|background)=([\"\'])[\s\S]*?([\"\'])/i";//去除某些特定的标签属性 $str = preg_replace($preg, "", $str); $preg = "/