// Read the file to the array $csv
$csv = array_map("str_getcsv", file('filename.csv',FILE_SKIP_EMPTY_LINES));
// Extract keys (column names) from first line of $csv
$keys = array_shift($csv);
// Combine the arrays $csv and $keys for each row
foreach ($csv as $i=>$row) $data[$i] = array_combine($keys, $row);