本文操作环境:windows7系统、PHP7.1版,DELL G3电脑php 怎么清除 script?php去除html中的script代码如下://去除 script 脚 本 function delScript($string){
本文操作环境:windows7系统、PHP7.1版,DELL G3电脑
php 怎么清除 script?
代码如下:
//去除 script 脚 本
function delScript($string){
$pregfind = array("/<script.*>.*<//script>/siU",'/on(mousewheel|mouseover|click|load|onload|submit|focus|blur)="[^"]*"/i');
$pregreplace = array('','');
$string = preg_replace($pregfind, $pregreplace, $string);
return $string;
}
主要是 将<script></script> 及中间的部分给 replace 为空了。
--结束END--
本文标题: php 怎么清除 script
本文链接: https://www.lsjlt.com/news/153.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2023-09-27
2023-09-27
2023-09-27
2023-09-26
2023-09-26
2023-09-26
2023-09-26
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0