fortnox007 Posted September 8, 2010 Share Posted September 8, 2010 HI all, something that keeps bothering me is that i do not fully understand the usefullness of the \n newline character. When i use for testing in a string it doesn't show the effect in my browser. Only when I press view source I can see that right after the \n character the code jumps down 1 line. Does anyone know how and when to use it? I have see it with the php mail function, but i don't really understand why they use it. If someone could enlighten me i would be very happy Quote Link to comment Share on other sites More sharing options...
ram4nd Posted September 8, 2010 Share Posted September 8, 2010 I can give you 1 useful reason for it. You can put Google ads JavaScript code to one line in your php file. But I see no point id using it for sourecode either, since there are things like firebug or how ever they call the same thing in chrome that is not extension and is more usable. Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 8, 2010 Author Share Posted September 8, 2010 hmm, this is weird. Could it maybe has something to do with writing an email in plain text instead of html? Well if someone knows I would love to hear it Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted September 8, 2010 Share Posted September 8, 2010 They're used in mail headers, HTTP headers and almost all other headers to distinguish between each individual header. Also you'll need them in CSV/text files to distinguish the lines. A newline character will be rendered in text (text file, text viewer, text email etc.). In HTML it only applies to the source code which is text. To generate an HTML line break you'll need <BR>. Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 8, 2010 Author Share Posted September 8, 2010 I was a little close than Thx alot AbraCadaver for this detailed response. Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 8, 2010 Author Share Posted September 8, 2010 Ah now i know why in a mail form they warn for the \n character. In case someone adds a bcc I guess. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.