[SOLVED] writing to file and new line

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
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

writing to file and new line

Post by pelegk2 »

i am writing text into a text file
and i want the line to go to a new line on every certain time
how do i do that?
thnaks in advance
peleg
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Write a "\n" to the file.
Eg
fputs($fp, $whatever."\n");

Be sure to use "\n" and not '\n' and depending on your operating system you may need to use \r\n instead of \n
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

i did \r\n and it works :)
Post Reply