(.*?)/"; //内容部分
//生成电子书
for( $i = $array_book[1]; $i $url = "http://vip.book.sina.com.cn/book/chapter_{$array_book[0]}_{$i}.html";
$html = file_get_contents($url);
preg_match_all($title_pre,$html,$title);
preg_match_all($contents_pre,$html,$contents);
$fh = fopen($array_book[3].'.txt','a+');
$write_contents = $title[1][0]."\r\n".str_replace('',"\r\n",str_replace('
',' ',$contents[1][0]))."\r\n";
if( fwrite($fh,$write_contents) ){
echo '第'.$i.'节抓取完毕';
}
fclose($fh);
}