I am using the PHP code:
$numberNewline = $number . \'\\n\'; fwrite($file, $numberNewline);
to write $number to a file.
For some reason
None of the above worked for me but it was so simple - here is the code... please use the KISS method.
echo file_put_contents("test.txt","\r\n \r\n$name \r\n$email \r\n$phone", FILE_APPEND);
It set a new blank line and then appends one line at a time.