Re: Replace linefeed/newline from text inputs with <br> tag?
| From: | David T-G | Date: | Mon, 23 Sep 2002 12:19:32 +0000 |
| Subject: | Re: Replace linefeed/newline from text inputs with <br> tag? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117264@lists.php.net to get a copy of this message | ||
John, et al --
..and then John Holmes said...
%
% Okay, you got me on that one, but why do you need to remove the
In my case, I had a newline-delimited file of
field@@data
field@@data
field@@data
and when the data had an embedded newline like
comment@@this is a
long comment
field@@data
then it messed things up. Yeah, I learned about the possibility of using
XML along the way, and I've already thought about serialize and base64
(which I *do* use inside the code, though not out in the file) for simple
protections, but a requirement was that the text file also be readable
and editable by people -- and, besides, I'm just extending this code
rather than writing it :-)
% newlines? It should be stored in the database (if you're doing so) with
% the newlines and not the HTML breaks. You only use the nl2br() to
% output it on a web page, so who cares if the new lines are still there?
For output, it doesn't matter, as you say. My problem was input :-)
%
% The manual page explains this correctly, btw. It says that a "<br />"
% will be inserted before all newlines.
Yeah, but that requires actual reading ;-) Who knows any more what TFM is?
%
% ---John Holmes...
HTH & HAND
:-D
--
David T-G * It's easier to fight for one's principles
(play) davidtg@justpickone.org * than to live up to them. -- fortune cookie
(work) davidtgwork@justpickone.org
http://www.justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!