21,887
社区成员
发帖
与我相关
我的任务
分享
$fname1=("pending.txt");
$fp1=fopen($fname1, "r+");
while(!feof($fp1))
{
$read=explode(";", fgets($fp1));//字符串中用;来打成数组
echo "read[0]= ".$read[0];// 用来测试
echo "<br/>";
}
fclose($fp1);
while(!feof($fp1))
{
$read=explode(";", fgets($fp1));//获取txt中的行并且打成数组
if(read[0]==userinfo_en[0]&&read[2]==userinfo_en[2])
{
file_put_contents($file,fgets($fp1));
}
}
fclose($fp1);
//userinfor_en = username ;password; ccn ;exp; cvv; type ;
// 0 1 2 3 4 5
//这个是从别的地方用GET拿到的,意思就是执行的时候如果
//读到接收到数据就把包含接收到的这一行全删了,可是我用了后直接除了该行,其余的行全删了。这才是核心问题,请问该如何
//解决呢?我想了好久了
while($buf = fgets($fp1))
{
$read=explode(";", $buf);//字符串中用;来打成数组
echo "read[0]= ".$read[0];// 用来测试
echo "<br/>";
}