New-line without break-tags

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rincewind
Forum Commoner
Posts: 27
Joined: Thu Nov 21, 2002 11:15 am
Location: Norway

New-line without break-tags

Post by Rincewind »

I have a script that collects data from a user then inserts it into MySQL.
One of the fields collected is a textarea that's inserted into a longtext-field.
This works just fine, my problem is that users aren't very good at inserting break-tags, and
I need the data collected to be somewhat easily read, how can I get the break-tags inserted
automatically for each new-line the user enters?

Thanx

Rincewind_the_Wizzard
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Post by DynamiteHost »

Code: Select all

$new = nl2br($old);
Hope that helps :)
Rincewind
Forum Commoner
Posts: 27
Joined: Thu Nov 21, 2002 11:15 am
Location: Norway

hmmm

Post by Rincewind »

Thanx a lot, that did the trick :)

Rincewind_the_Wizzard
Post Reply