Guest User

Untitled

a guest
Jan 12th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $filename = "upload/".$_GET['file']; // output is "upload/example.csv";
  2. $fp = fopen($filename, 'r');
  3. // Headrow
  4. $head = fgetcsv($fp, 4096, ';', '"');
  5.  
  6. // Rows
  7. while($column = fgetcsv($fp, 4096, ';', '"'))
  8. {
  9. // This is a great trick, to get an associative row by combining the headrow with the content-rows.
  10. $column = array_combine($head, $column);
  11.  
  12. echo $column['column1'];
  13. }
Add Comment
Please, Sign In to add comment