daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top