Re: Reading File Contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 25 Aug 2003, The Cossins Fam wrote:

} I've tried the nl2br function, as well as adding "\n" to the end of each 
} line and using fgets to replace "\n" with "<br>".  However, nothing seems to 
} be working.  I'm probably missing something very simple, but if someone 
} wouldn't mind helping a rookie out, I'd appreciate it.

If the files were written under Windows/UNIX/Mac OS 9-, you will need to 
add more than just "\n" to your ereg_replace:

$message = ereg_replace("(\r\n|\n|\r)", "<br>\n", $message);

This should take care of all 3 kinds of line breaks/form feeds [windows, 
Mac, and UNIX based systems all define what happens when the user hits the 
"return/enter" key differently].

/vjl/

-- 
Vince LaMonica               UC Irvine,  School  of  Social Ecology
 W3 Developer       <*>      116 Social Ecology I, Irvine, CA 92697
 vjl@uci.edu                  http://www.seweb.uci.edu/techsupport

        You should not confuse your career with your life.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux