龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

请问如和使用PHP将一个网页完整地保存到本地啊

时间:2014-07-22 14:50来源: 作者: 点击:
分享到:
思路已经有了谁来实现下
思路已经有了谁来实现下
<?php 
 $content = file_get_contents('http://www.baidu.com'); 
 $file = fopen("baidu.htm","w"); 
 fwrite($file, $content);//百度首页8K 
 fclose($file);
/*____________________*/

如果要下载全部的东西,可以分三步实现: 
1.file_get_contents()页面 
2.file_get_contents() 页面包含的js,css ,
3.copy() css中的图片
精彩图集

赞助商链接