<?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标记及其内容都去掉)
微信公众号

手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_55202.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
