/**
* @name 採集書.php
* @date Sun Mar 01 22:48:02 CST 2009
* @copyright 馬永佔(MyZ)
* @author 馬永佔(MyZ)
* @link http://blog.csdn.net/mayongzhan/
*/
//header('Content-Type:text/html;charset=utf8');
header('Content-Type:text/html;charset=gb2312');
錯誤報告(E_ALL);
date_default_timezone_set('亞洲/上海');
set_time_limit(0);
函數編寫器($content,$url)
{
$fp = fopen($url, 'ab');
fwrite($fp, $content);
fclose($fp);
}
$folder = '2'; //資料夾
$book_base_url = 'xxxxxxxxxxxxxxxxxxxxxxxx';
$book_url = 'yyyyyyyyyyyyy.html';
$main = file_get_contents($book_base_url.$book_url);
preg_match_all('/chapter_.*?.html/', $main, $pages);
$pages = array_unique($pages[0]);
foreach ($pages as $value) {
writer(file_get_contents($book_base_url.$value), './'.$folder.'/'.$value.'.txt');
$str = file_get_contents('./'.$folder.'/'.$value.'.txt');
//print_r($str);
preg_match("/(
|
/","rn",$arr[6]));