Newline and lineFreak

  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Okay so the way to add a new line is \n. the ascii code is chr(13)

How to i add a linefeed? have tried \n. have tried chr(13) and I have tried chr(10) and they all generate a funny little block in Notepad.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Okay found the solution.

Here it is for all you guys (just though along the terms of VBCrLf and found) this)

Code: [ Select ]
Macintosh: \r
Unix  : \n
Windows : \r\n
  1. Macintosh: \r
  2. Unix  : \n
  3. Windows : \r\n


on http://za.php.net/nl2br .
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

rapid, you do some coding out of this world dude.

Quote:
Macintosh: \r
Unix : \n
Windows : \r\n



do i need to say more?
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

huh?
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

I recently came across something similar while pulling my hair out working with javascript and line endings in textareas. It turns out that the browsers - IE particulary- add another layer of differences in how they handle newlines in textareas on different platforms.

Anyway I found this to be useful:

Line endings in Javascript - SitePoint DHTML & CSS Blog

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 151 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.