Hi,
I created a couple of web applications with php and mysql and i have
a problem that keeps coming up.

I want to use html text boxes that will send information to the
database but i want it to include line breaks....
until now i just typed in <br/> at the end of the line but this time
it's for a client and i have to implement line breaks to the database.
is there a php function that can handle that ?

Thanks!

Recommended Answers

All 6 Replies

use "/n"

use "/n"

Right, then the nl2br() function converts /n into <br />

Yeah,, but my client is going to do the typing and he just want
to hit return and go to the next line without having to add extra characters

right, that's how it works :) the function nl2br() converts new lines into <br>s. That's what we use for our editor window here on DaniWeb.

So if someone types a message in an HTML text box and hit
return, the computer generates a \n automatically ?

thanks for all your help...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.