Home > php教程 > PHP源码 > body text

php采集后的处理

WBOY
Release: 2016-06-08 17:31:19
Original
1096 people have browsed it
<script>ec(2);</script>

 

 


/**
 * @name 采集后的处理.php
 * @date Sat Dec 22 02:07:45 CST 2007
 * @copyright 马永占(MyZ)
 * @author 马永占(MyZ)
 * @link http://blog.111cn.net/mayongzhan/
 */
 
//采集后的文件,然后那来进行处理.这里的东西让我抄了5本书,是哪的不方便提供,自己找找吧.
 
header(''Content-Type:text/html;charset=utf8'');
 
function writer($content,$url)
{
    $fp = fopen($url, ''ab'');
    fwrite($fp, $content);
    fclose($fp);        
}
 
//从1到136页的内容一次合并.这个是最爽的...
 
for ($i=1;$i    $str = file_get_contents(''./myz/''.$i.''.shtml'');
    preg_match("/(

)(.*?)(

)(.*?)(
)(.*?)(
)/s",$str,$arr);

    $arr[6] = preg_replace("/(]+>.*?]+>)(.*?)()/s","$2",preg_replace("/

|

/","rn",$arr[6]));

    $result = "rn------------------------------------------------rn------------------------------------------------rn------------------------------------------------rn".$i."----------------马永占的目录编号:".$arr[2]."rn------------------------------------------------rn------------------------------------------------rn------------------------------------------------rn".$arr[6];
    writer($result, "./myz/all.txt");
}
?> 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template