I having a problem getting my file to look like this
@email1.com
@email2.com
@email3.com
Instead, when i write the contents of an array to a file it looks like this.
@email1.com@email2.com@email3.com
When i gather the information during processing i do alot of trimming so i would need to be able to add back /n before writing. I'v tried various methods including the explode method but all i get are errors.
Here is an example of a routine where i would need to write to a file and add /n after every record is written.
$file1 = file ($datafile);
$file2 = array_map ('trim', $file1);
$file3 = array_unique ($file2);
$file00 = fopen ($datafile, 'w');
foreach ($file3 as $line)
{
fwrite ($file00, $line . '');
I did try;
fwrite ($file00, $line . "\n"); but this didnt work.