Re: How can I format text in textarea?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bushra wrote:
Hi
When I enter text as more than on paragrahs in a textarea field,The text is displayed in one solid block of text even though I have entered it in paragraphs. How I can to insert line breaks in the text. (The values of textarea is stored in database and then displayed.)

If you have the text in $string, then this will output it safely and with correct line breaks:

print(nl2br(htmlspecialchars($string)));

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux