Jump to content

Archived

This topic is now archived and is closed to further replies.

xyn

Detecting Line breaks.

Recommended Posts

Hi,
I wanted to insert some things into my database so the linebeaks do not get removed.
basically to send a private message and When I input:
[sup]Hi,
How are you?
ps. test[/sup]

it looks like:
[sup]Hi, How are you? p.s test[/sup]

Does anyone know what I can do?

Share this post


Link to post
Share on other sites
when you're echoing it from the database, use nl2br().

Share this post


Link to post
Share on other sites
Thanks, would that be:

[code=php:0]<?PHP

echo 'nl2br(CODE HERE)';[/code]

Share this post


Link to post
Share on other sites
[code]echo nl2br($variable_containing_the_post);[/code]

Share this post


Link to post
Share on other sites
oh yes :P thank you

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.