new line with fwrite()

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
Artemus
Forum Newbie
Posts: 4
Joined: Fri Sep 20, 2002 10:16 am
Location: Greece

new line with fwrite()

Post by Artemus »

Hello,

I am trying to write in a file two lines...
I use : fwrite($fp, "\n");
for going to the next line but it doesn't work...

what should I do?

Thanks..
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

What operating system are you on? You may need to use some combination of \n's and \r's.

*nix wants \n's
Windows and Macs need a different set, which I don't remember off hand.
Artemus
Forum Newbie
Posts: 4
Joined: Fri Sep 20, 2002 10:16 am
Location: Greece

operating system... :-(

Post by Artemus »

For the development I use windows xp with Apache 1.3 runing.

I have uploaded the projet to the server which has Linux Red Hat with apache and everything work correctly now.

I should develop under linux... 8)

Thanks...
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I think windows wants \r\n (or maybe flipped, I know it needs both)

I think mac is just \r
Post Reply