Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $filename = "upload/".$_GET['file']; // output is "upload/example.csv";
- $fp = fopen($filename, 'r');
- // Headrow
- $head = fgetcsv($fp, 4096, ';', '"');
- // Rows
- while($column = fgetcsv($fp, 4096, ';', '"'))
- {
- // This is a great trick, to get an associative row by combining the headrow with the content-rows.
- $column = array_combine($head, $column);
- echo $column['column1'];
- }
Add Comment
Please, Sign In to add comment