Check this out - it just might be helpful:
http://www.php.net/manual/en/ref.filesystem.php#ini.auto-detect-line-endings
Does require PHP 4.3.0 (currently at RC3) though. Here's what it says:
auto_detect_line_endings boolean
When turned on, PHP will examine the data read by fgets() and file() to
see if it is using Unix, MS-Dos or Macintosh line-ending conventions.
This enables PHP to interoperate with Macintosh systems, but defaults to
Off, as there is a very small performance penalty when detecting the EOL
conventions for the first line, and also because people using
carriage-returns as item separators under Unix systems would experience
non-backwards-compatible behaviour.
Note: This configuration option was introduced in PHP 4.3.
-Dash
-----Original Message-----
From: Sterling Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Dealing with Mac files
I am working on an application for a school district and am having some
problems with the files they are supplying for import.
They are supplying data files and I am writing routines to populate the
database using these files. Its a simple file upload then I just need to
parse through the tab separated value file. I am using the most recent
PHP build on Windows with IIS ISAPI and a MSSQL database. They are
sending text files from a Macintosh application.
I noticed on the documentation for fgetcsv() that it cannot read the end
of line character on Mac files. I have not been able to find a good work
around for this issue. When I grab the entire contents of the file then
try doing a string replacement on the "\r" or even "\t" for that matter
it does not work.
Has anyone found a good solution for dealing with Mac files?
_______________________________________________________________
Sterling Anderson
Systems Analyst email: [EMAIL PROTECTED]
Heartland Business Systems
http://www.hbs.net
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php