It depends entirely on how you are outputting them. If output as part of your HTML output, it won't matter, since HTML ignores whitespace, such as newlines, when displayed by a web browser. So, if you're outputting them in an HTML table, say, just make the coumn wider: it won't matter what the raw HTML looks like, as far as the browser is concerned.
If you are producing an XML document, or suchlike, you'll have to reformat the text as delivered from the database, removing newlines wth something like:
$textfield=str_replace(chr(13), "", $text field);
..a.nd then:
$textfield = chunk_split($textfield, {chunklength}, {endcaharcter})
Where chunklength, is the number of columns, per line, you'd prefer, and endcharacter, is the end-of-line character youw ant to insert, such as the carriage return/linefeed combination for Windows machien s (i.e. "\r\n").
Either way, the text in each text-type field is part of the text, newlines, tab-characters, and all, so reformatting it is the job of PHP extraordinarily extensive array of string-manipulation functions.
HTH
Dan
|