Created
January 31, 2011 22:23
-
-
Save bigpresh/804963 to your computer and use it in GitHub Desktop.
PHP CSV parsing example for Jim
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
[davidp@supernova:~/tmp/php-csv-test]$ php php-csv-test.php | |
array ( | |
0 => | |
array ( | |
'name' => 'David Precious', | |
'age' => '29', | |
'comment' => 'rocks', | |
), | |
) |
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 | |
require_once 'File_CSV_DataSource-1.0.1/DataSource.php'; | |
$csv = new File_CSV_DataSource; | |
$csv->load('test.csv'); | |
var_export($csv->connect()); | |
?> |
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
name | age | comment | |
---|---|---|---|
David Precious | 29 | rocks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://code.google.com/p/php-csv-parser