Created
June 8, 2011 19:27
-
-
Save umpirsky/1015158 to your computer and use it in GitHub Desktop.
Read csv file with a style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = new SplFileObject('/path/to/file.csv', 'rb'); | |
$file->setFlags(SplFileObject::READ_CSV | SplFileObject::SKIP_EMPTY); | |
$file->setCsvControl(';'); | |
foreach($file as $data) { | |
// $data is array | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment