What is the use of PHP_EOL

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jerrystar
Forum Newbie
Posts: 1
Joined: Tue Oct 21, 2008 12:20 am

What is the use of PHP_EOL

Post by jerrystar »

What is the use of PHP_EOL,generally in which case we will be using this?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: What is the use of PHP_EOL

Post by pickle »

Different operating systems use different characters to signify an end of a line in a file. Rather than hardcoding to use "\L" (which isn't really a character - just an example), you can use PHP_EOL, which will allow your script to be more cross-OS compatible.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: What is the use of PHP_EOL

Post by Chalks »

what else is used besides \r\n and \n?
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: What is the use of PHP_EOL

Post by mikemike »

None really. Read until your heart's content ;) : http://en.wikipedia.org/wiki/Newline
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: What is the use of PHP_EOL

Post by Chalks »

heh. Show me someone who doesn't love wikipedia and I'll show you someone who doesn't have a soul. :bow:
Post Reply