<?php
header("content-type:text/html;charset=utf-8");
$script = "以下内容不显示:<script type='text/javascript'>alert('cc');</script>";
$pattern = '/<script[^>]*?>.*?<\/script>/si';
echo preg_replace($pattern, "脚本内容", $script);//以下内容不显示:脚本内容
?>
php写出一个正则表达式,过虑网页上的所有JS/VBS脚本(即把script标记及其内容都去掉)
微信公众号

手机浏览(小程序)
