显示进度

This commit is contained in:
gently 2019-12-15 10:20:25 +08:00
parent 06bcb0dc3d
commit ea4ef100bc

View File

@ -52,14 +52,15 @@ $r = new Net_DNS2_Resolver(array('nameservers' => array('223.5.5.5', '223.6.6.6'
$src_fp = fopen($src_file, 'r'); $src_fp = fopen($src_file, 'r');
$cnt = 0;
while(!feof($src_fp)){ while(!feof($src_fp)){
$row = fgets($src_fp, 512); $row = fgets($src_fp, 512);
echo '[', date('m-d H:i:s'), '],', ++$cnt, "\n";
if(empty($row)){ if(empty($row)){
continue; continue;
} }
echo $row;
if(preg_match('/^address=\/(.+)?\/$/', $row, $matches)){ if(preg_match('/^address=\/(.+)?\/$/', $row, $matches)){
try{ try{
$result = $r->query($matches[1], 'A'); $result = $r->query($matches[1], 'A');