Re: Reading File Contents
| From: | Vince LaMonica | Date: | Mon, 25 Aug 2003 23:29:44 +0000 |
| Subject: | Re: Reading File Contents | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30091@lists.php.net to get a copy of this message | ||
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.