Preformatted text in PHP
Posted: Wed Oct 12, 2005 10:17 am
I've got a text area and the form in which it is connects to a php file. Now, the text that is entered by the user may contain breaks. However, when I try displaying that text by using echo, it shows all in one, without breaks.
I tried using the pre tags, but then if the user enteres a long string, i get a horizontal scroll bar. Is there any way to convert the breaks in a given string into tags (ie. introducing <BR> at the right place). Or else, if there is some way of wrapping text within pre, i could use that as well.
I tried using the pre tags, but then if the user enteres a long string, i get a horizontal scroll bar. Is there any way to convert the breaks in a given string into tags (ie. introducing <BR> at the right place). Or else, if there is some way of wrapping text within pre, i could use that as well.