Is it possible to use fgetcsv in PHP to open a tab-delimited file?
views:
184answers:
2
+1
A:
yes, you can specify tab "\t" in its parameters. see the doc.
while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE)
ghostdog74
2010-04-06 00:53:16
+2
A:
$csvData = fgetcsv($fileHandle, 0, "\t");
Where $fileHandle is a valid file handle. The 0 is just to tell the function not to limit seeking through lines (however you can change this to suit, the docs do say not imposing a limit decreases performance).
alex
2010-04-06 00:55:41
is the tab delimiter different for macs?
Brian
2010-04-06 01:39:56
@Brian I've had a quick Google, and I don't think so. Usually that's just line endings and line feeds.
alex
2010-04-06 04:30:04