Page 1 of 1

New-line without break-tags

Posted: Mon Dec 09, 2002 1:24 pm
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

Posted: Mon Dec 09, 2002 1:29 pm
by DynamiteHost

Code: Select all

$new = nl2br($old);
Hope that helps :)

hmmm

Posted: Mon Dec 09, 2002 3:45 pm
by Rincewind
Thanx a lot, that did the trick :)

Rincewind_the_Wizzard