I don't know...your code looks like a big jumble tbh.
Find wherever you're writing to the file, and either put that in the loop, or concatenate a string to write to the file.
Errors in File Handling program
Moderator: General Moderators
Re: Errors in File Handling program
jackpf thanks for ur support, actually i missed the append mode in the fileWrite(), now my task is fulfilled, thanks mate
Code: Select all
function fileWrite($export)
{
$myFile = "phonedetails.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "$export";
fwrite($fh, $stringData);
fclose($fh);
}Re: Errors in File Handling program
Cool, nice one.