Rob, et al --

...and then Robert Cummings said...
% 
% David T-G wrote:
% > 
% I've never had problems with doing:
% 
%     $foo = "I don't like\nnewlines";
% 
%     $foo = ereg_replace( "\n", '<br />', $foo );

I'm afraid I do.  Given my code

      $fin = stripslashes(${base64_encode($k)}) ;       ###
      print "\$fin is .$fin.<BR>\n";    ###
      $fout = ereg_replace("\n","<br>",$fin) ;
      print "and \$fout is .$fout.<BR>\n";      ###

(ignore the scary base64 stuff :-) I get

  $fin is .This is the first line. Here is the second line..
  and $fout is .This is the first line. 
  Here is the second line..

in my browser and

  $fin is .This is the first line.
  Here is the second line..<BR>
  and $fout is .This is the first line.
  <br>Here is the second line..<BR>
  <br><br>

in my browser's source window.  The newlines are still there.

Any thoughts?


% 
% Cheers,
% Rob.


Thanks & HAND

:-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: msg78076/pgp00000.pgp
Description: PGP signature

Reply via email to