文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>php获取网站内容,保存为txt文件源码(原创)

php获取网站内容,保存为txt文件源码(原创)

时间:2007-07-27  来源:makewong

";  //显示工作状态
      $file_handle_txt = fopen($my_book_txt_over_url, "r");  //读取转换后的抓取地址
      while (!feof($file_handle_txt)) {
       $line_txt = fgets($file_handle_txt);
       $line1=ereg("^&nbsp.+",$line_txt,$reg); //根据抓取内容标示抓取
       $my_over_txt=$reg[0];
       $my_over_txt=str_replace("    ","    ",$my_over_txt); //过滤字符
       $my_over_txt=str_replace("
","",$my_over_txt);
       $my_over_txt=str_replace("","",$my_over_txt);
       $my_over_txt=str_replace(""","",$my_over_txt);
       if ($line1) {
         $handle1=fwrite($handle,"$my_over_txt\n"); //写入文件
       }  
      }
    }
}
fclose($file_handle_txt);
fclose($handle);
fclose($file_handle); //关闭文件
echo "完成";
?>


相关阅读 更多 +
排行榜 更多 +
下载oe

下载oe

金融理财 下载
易欧app官方下载安装

易欧app官方下载安装

金融理财 下载
易欧app官方免费下载

易欧app官方免费下载

金融理财 下载