Jump to content

What is "\n" used for in PHP


maestrodamuz

Recommended Posts

The technical definition of it, since the other two posts have just told you its name and what it's used for:

 

It stands for, and is parsed into by the PHP engine, the value of the newline character.  In ASCII, for example, the new line character is 10 (in decimal), so a char with a value of 10 would be a new line.  In C or some other lower level language it would make more sense.

 

In C:

 

char c1 = '\n';
char c2 = 10;

 

Those would be the same in memory or as human readable output.

 

 

Hrmm, so I guess this post didn't add anything new.... Oh well, already typed it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.