源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

PHP批量获取网页中所有固定种子链接的方法

  • 时间:2020-02-22 09:44 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:PHP批量获取网页中所有固定种子链接的方法
本文实例讲述了PHP批量获取网页中所有固定种子链接的方法。分享给大家供大家参考,具体如下: 经常的下载链接比较多的时候,就像一次性将所有的链接添加到迅雷或者电炉,但是没有在这种选项,怎么办,咱是PHPer啊,这事儿难不到咱 且看代码,当然要换成你的,要根据具体情况来做修改。
<?php
header("content-type:text/html;charset=utf8");
$str = file_get_contents('./ShowFile.asp');
$str1 = '<a href="ed2k';
$str2 = '">';
$pos1 = 0;
$pos2 = 0;
$pos3 = 0;
$len = strlen($str);
$ed2k = '';
for($i=5000;$i<$len; ){
  $pos1 = strpos($str,$str1,$i) + 9;
  $pos2 = strpos($str,$str2,$pos1) - 2;
  $pos3 = $pos2 - $pos1;
  //说明特征连接已经不存在 放弃寻找
  if($pos1 == 9){break;}
  $ed2k = substr($str,$pos1,$pos3+1)."\r\n";
  file_put_contents('d:/log/a.txt',$ed2k,FILE_APPEND);
  echo substr($str,$pos1,$pos3+1).'<hr/>';
  $i = $pos2;
}
?>

更多关于PHP相关内容感兴趣的读者可查看本站专题:《[url=http://www.1sucai.cn/Special/66.htm]php curl用法总结[/url]》、《[url=http://www.1sucai.cn/Special/623.htm]PHP数组(Array)操作技巧大全[/url]》、《[url=http://www.1sucai.cn/Special/150.htm]php排序算法总结[/url]》、《[url=http://www.1sucai.cn/Special/242.htm]PHP常用遍历算法与技巧总结[/url]》、《[url=http://www.1sucai.cn/Special/614.htm]PHP数据结构与算法教程[/url]》、《[url=http://www.1sucai.cn/Special/111.htm]php程序设计算法总结[/url]》、《[url=http://www.1sucai.cn/Special/630.htm]PHP数学运算技巧总结[/url]》、《[url=http://www.1sucai.cn/Special/180.htm]php正则表达式用法总结[/url]》、《[url=http://www.1sucai.cn/Special/357.htm]PHP运算与运算符用法总结[/url]》、《[url=http://www.1sucai.cn/Special/47.htm]php字符串(string)用法总结[/url]》及《[url=http://www.1sucai.cn/Special/231.htm]php常见数据库操作技巧汇总[/url]》 希望本文所述对大家PHP程序设计有所帮助。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部