Welcome Guest, Not a member yet? Register   Sign In
[Problem solved] How to echo Line Feed?
#1

[eluser]solid9[/eluser]
When I try to save this paragraph into database below for example,
Code:
This is line one.
This is line two.

This is line three.
This is line four.

And try to echo it,
It convert into this below,
Code:
This is line one. This is line two.This is line three.This is line four.

meaning it's not echoing the original format.

So how do I echo the original format with line feed and spacing?
Also How do I make it so It will accept HTML tags as well aside from pure text only.

Thanks in advanced.

#2

[eluser]Rayhan[/eluser]
Try Rich Text Format
#3

[eluser]Dan Storm[/eluser]
Use the nl2br() function - this automatically changes \n to
Code:
<br>
.

Quote:Also How do I make it so It will accept HTML tags as well aside from pure text only.

You need to aloborate this - a simple textarea/textfield can recieve any kind of input.
#4

[eluser]solid9[/eluser]
Thanks guys.

Problem solved.




Theme © iAndrew 2016 - Forum software by © MyBB