Not sure what might be the problem.
I flush the data from the array $theArrayto theFile.txt, each element of the array on a separate line.
$file = fopen("theFile.txt", "w");
foreach ($theArray as $arrayItem){
fwrite($file, $arrayItem . '\n');
}
fclose($file);
The problem is , when I open theFile.txt, I see what \nis displayed literally. Also, if I try to programmatically read a file line by line (just in case, lines there), it shows them as 1 line means they \nreally don't have the desired effect.
source
share