php代码|读取指定网页无限生成html文件-组合第二步

时间:2年前   阅读:442
<?php
 $urls="http://www.chfkw.cc/sly";//定义要采集的路径
 $fo=fopen($urls,"r");//以只读方式打开url
 $content=@file_get_contents($urls);//通过url获取内容
 echo $content;//打印对应网站内容
//eregi("<title>(.*)</title>",$content,$titles);//用正则表达式读取网站title标签内容
 print_r($content);//打印数组title
 
 //$tijiao = $_POST['tijiao'];
 $fc = file_get_contents("xw.txt");
 $fff = fopen("xw.txt", "w");
 $count =$fc+1;
 $paths="htm/xw".$count.".html";//定义要生成的html路径
 $handles=fopen($paths,"w");//以可写方式打开路径
 fwrite($handles,$content);//写入内容
 fclose($handles);//关闭打开的文件
 	$fd = fwrite($fff,$count);
	fclose($fff);
?>

懂得都懂

php代码|读取指定网页无限生成html文件-组合第二步

上一篇:php代码|把PHP文件转换成html静态文件-组合第一步

下一篇:PHP代码|获取指定网址内所有链接

网友评论