PHP newline not working in text file
'\n'
in single quotes is a literal \n
."\n"
in double quotes is interpreted as a line break.
http://php.net/manual/en/language.types.string.php
$numberNewline = $number . "\n";
fwrite($file, $numberNewline);
Try this