M
|
MikeT 12/18/2020 |
You probably need to fopen() with the correct option (probably a for append), otherwise you overwrite each entry with the next and the last then being the only one in the file. |
D
|
Daniedb 12/18/2020 |
foreach ($foodArray as $food) { $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $food ."\r\n"; fwrite($fh, $stringData); } fclose($fh);
|
I
|
Ivan van Oosterhout author 12/18/2020 |
Thank you very much Danie, |