Rob, et al --

...and then Robert Cummings said...
% 
% David T-G wrote:
% > 
% > ...and then Robert Cummings said...
% > %
...
% > %     $foo = str_replace( "\n", '<br />', $foo );
% > %
% > % That one work for you? It's more efficient too.
% > 
% > Actually, no.  I thought about listing all of the things I had tried (and
...
% > well as the $fin and $fout separation.  I always have the newline left
% > behind.
...
% 
% *ACK* Stoopid microsoft... it's the "\r" character I bet.

That was it, or at least sort of.  Thank heavens I always test before I
post, because I was going to smugly comment that I'm using freebsd *but*
I tried switching to \r and noticed that the added <br> moved from one
line to the other.  So I whipped up

  $fout = ereg_replace("(\n|\r)+","<br>",$fin) ;

and it works -- there must actually be \r\n there -- and I'll work
backwards from there (I'll use an expression like the above to robustly
handle by-god-anything that comes in!) to get rid of these temp variables.


% 
% Cheers,
% Rob.


Thanks a *bunch*!

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg78087/pgp00000.pgp
Description: PGP signature

Reply via email to