View Single Post
Old 02-04-2004, 05:54   #6 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,930
I ended up using this:
Code:
$text = ereg_replace("\r","",$text); $text = ereg_replace("\n","<br />\n",$text); $text = ereg_replace(".<br />","\n</p>\n<p>",$text);

It enables me to format the contents of the txt file in a way that matches the surrounding markup (à la view source).

nl2br() is great, but a little too basic for my (pedantic) needs.


I'm wearing my PHP is fun! badge today.
  Reply With Quote