Jump to content

Archived

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

Demonic

nl2br() question

Recommended Posts

alright im using nl2br() to make new lines and i got a textarea to view your current signature

is thier a way for the <BR>'s to be hidden in edit script script but the <br> still work?
'
like hidden <BR>'s in textarea's

Share this post


Link to post
Share on other sites
[quote]is thier a way for the <BR>'s to be hidden in edit script script but the
still work?[/quote]

That doesn't make sense

Share this post


Link to post
Share on other sites
Use str_replace:
[code]$text = str_replace(array("<br>", "<br />"), '', $text);[/code]

I guess you use nl2br when inserting data to the database, this is not recommended. You should save data in its raw state in the database. Then you format the data how you want it to be displayed when you get it out of the database.

Share this post


Link to post
Share on other sites
Also, you'd be much better off storing th eplain text in the database and using nl2br() on the way out.

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.