I am doing a chat with a text file. Very simple, but I do not want it to put a damper on the server. Anyway. When I try to make a message, it adds the added message to the same line as
Alan,5/6/12,message<br>Joe,5/6/12,hello<br>
I wish it were
Alan,5/6/12,message
Joe,5/6/12,hello
This is what I have.
$total = 'Alan,5/6/12,hello joe<br>\r\n';
$fn = "messages.txt";
$file = fopen($fn,"a");
fwrite($fn,$total);
fclose($fn);
Thank.
source
share