Quote:
quote:Originally posted by Tachyon
So, if a <textarea> feeds into a MySQL field, and then I print the database info to a file, the line breaks will be preserved?
|
Yes. The ideal field type to contain the data would be text, mediumtext, longtext, whichever is suitable given the necessary constraints on size. But the newline character is passed as part of the data and it won't get removed unless you run an algorithm to remove it specifically. When you write the data to a plain text file and open it with a plain text viewer you'll see the linebreaks where they occured in the <textarea> field. In a browser, when viewed in HTML it won't appear that way unless you use a function like nl2br to insert HTML line breaks or the other methods I mentioned, but if you view the source of the file you'll see the line breaks in the source where they occured in the <textarea> field.
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::