php fp fopen wait txt if fp echo Not found wait txt exit while feof fp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php
$fp=fopen("wait.txt","r");
if(!$fp)
{
echo "Not found wait.txt!";
exit;
}
while(!feof($fp))
{
$accounts=fgets($fp,4096);
if(preg_match("/ftp:\/\/([0-9a-z]+):([0-9a-z]+)@([a-z0-9]{3}).vip-file.com/i",$accounts,$result))
{
$accounts=$result[1].":".$result[2]."\n";
$fp1=fopen("accounts.txt","a");
fputs($fp1,$accounts);
fclose($fp1);
}
}
fclose($fp);
?>