I hve this little function to delete any line in a text file "maildatabasefile" that contains the string "$ticket"
function deleteaddress($ticket){
$filename = "$this->maildatabasefile";
$file = file("$filename");
$i = 0;
$tmp = "";
while ($file[$i]) {
if (!stristr($file[$i], $ticket)){
$tmp .= $file[$i];
$i++;
}
}
$file = fopen("$filename", "w");
fputs($file, $tmp);
fclose($file);
return 1;
}
It seems to never end though.
Why is it broken?
Thanks