csv table to array with column headers as keys
$all_rows = array(); $header = null; while ($row = fgetcsv($file)) { if ($header === null) { $header = $row; continue; } $all_rows[] = array_combine($header, $row); }