astralaaron Posted March 26, 2008 Share Posted March 26, 2008 i know the \r\n stands for carriage return, and newline...i understand it is like a <br> in htmlbut what exactly does a carriage return do? and the newline - i cant find it on php.net Link to comment Share on other sites More sharing options...
Synook Posted March 26, 2008 Share Posted March 26, 2008 Technically a carriage return resets the output caret to the leftmost margin. A line feed (which is \n) brings the caret down one line. In most modern systems, however, any of them seperate or in combination will do both at once. Different systems use different characters by default (DOS = \r\n, UNIX = \n, MAC = \r), but can recognise all. Link to comment Share on other sites More sharing options...
jeffg Posted March 26, 2008 Share Posted March 26, 2008 And if you are interested in history, in the olden days there used to be machines called typewriters with moving parts. The carriage was the bit with the roller where you put the paper, and it moved one space to the left each time you typed a character. At the end of the line you heaved on a lever to move the carriage all the way to the right, to return it to the start of the next line. Link to comment Share on other sites More sharing options...
jeffman Posted March 26, 2008 Share Posted March 26, 2008 Actually, the typewriter thing is no joke if you just change the word to teletype printer, which is where the first 128 characters come from. Didn't you ever wonder why one of them is called "bell"? Link to comment Share on other sites More sharing options...
AElliott Posted March 26, 2008 Share Posted March 26, 2008 My understanding that Macs no longer use \r (since they switched to Darwin based on BSD). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.