Forum Moderators: coopster

Message Too Old, No Replies

Line Break for TextArea Field

New line, Text Area

         

ajitaryan

7:22 am on Jun 7, 2008 (gmt 0)

10+ Year Member



Hi,

I used textarea for description and I want line break in that description when we press ENTER in description. this field(textarea) stored in xml file. when we want to display this description it showing same line. but I need in next line.
In localhost it showing in new line but on server it's not working,
Please suggest.
Thanks

henry0

11:15 am on Jun 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



new line to break [us2.php.net]

Pico_Train

3:49 pm on Jun 7, 2008 (gmt 0)

10+ Year Member



echo strslashes(nl2br($var)); - you might need the strslashes function to get rid of the pesky / in your echoed text.

PHP_Chimp

5:42 pm on Jun 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




if ([url=http://uk2.php.net/manual/en/function.get-magic-quotes-gpc.php]get_magic_quotes_gpc()[/url]) {
[url=http://uk2.php.net/manual/en/function.stripslashes.php]stripslashes[/url](nl2br($var));
}
else {
nl2br($var)
}

If you are worried about additional slashes then check using get_magic_quotes_* there is a function for gpc and runtime, depending on what you are worried about.