Appending to a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Templeton Peck
Forum Commoner
Posts: 45
Joined: Sun May 11, 2003 7:51 pm

Appending to a file

Post by Templeton Peck »

Is there anyway to make file write append to a new line after the data already in the file, instead of right behind it on the same line?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

by putting a "\r\n" or "\n" before the data
User avatar
Templeton Peck
Forum Commoner
Posts: 45
Joined: Sun May 11, 2003 7:51 pm

Post by Templeton Peck »

thanks :)

it turned out that under windows using "\n" in notepad does not add the line breaks but "\r\n" does. If you use wordpad though "\n" works just fine
Post Reply