php正则提取制表符分隔文件的404 url

http://www.baidu.com/s?ie=utf-8&tn=baidulocal&wd=site%3Apianpai.com

1
2
3
4
5
6
7
8
9
10
11
<?php
header("Content-type; text/html; charset=utf-8");
//////////////////////////////
$file="a.txt";//导出的制表符分隔的文件 (我用的xenu)
$head="http://pianpai.com";// 网址
$state="404";//状态码
///////////////////////
preg_match_all("/".str_replace("/","\/",$head)."(.*?)\s".$state."/i",file_get_contents($file),$result);
foreach($result[1] as $row)
{echo $head.$row."<br>";}
?>

保存为geturl.php放入PHP环境,注意制表符分隔的文件的路径问题。然后运行这个geturl.php,就得到了链接了~

Leave a Reply

You must be logged in to post a comment.

RSS feed for comments on this post. TrackBack URL