Re: Different OS, Different Line Break, Be a Little Problem
| From: | Daniel Convissor | Date: | Fri, 21 Jan 2005 18:32:08 +0000 |
| Subject: | Re: Different OS, Different Line Break, Be a Little Problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35668@lists.php.net to get a copy of this message | ||
Hi Firman:
I wouldn't worry about the OS. Just split the lines using a regular
expression for any combination of new line characters. Example
(untested):
$items = preg_split('/[\r\n]+/', $conents);
This also solves the issue of a file being created on one OS but imported
on another.
See you,
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409