CodeIgniter Forums
New line problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: New line problem (/thread-29586.html)



New line problem - El Forum - 04-14-2010

[eluser]Unknown[/eluser]
Hi everyone,

I'm working on project. I have submit form which inserts announcement into database. But when i pull the inserted data from database and print it on page. There is no new line. All text appears in same line in one paragraph. But in the database it is not one paragraph.

How can i print text as is?

Thanks


New line problem - El Forum - 04-14-2010

[eluser]danmontgomery[/eluser]
Use <pre> tags... <pre> indicates preformatted text, which will be output in a fixed-width font (courier, for example), and both line breaks and spaces are preserved.


New line problem - El Forum - 04-14-2010

[eluser]WanWizard[/eluser]
This is the way HTML works. Enters are just white-space, you need to convert them to breaks, p.e. using the PHP function nl2br().