$all_rows = array();
$header = fgetcsv($file);
while ($row = fgetcsv($file)) {
$all_rows[] = array_combine($header, $row);
}
print_r($all_rows);
More Related Contents:
- Split a comma-delimited string into an array?
- How to create an array from a CSV file using PHP and the fgetcsv function
- Convert array into csv
- php implode (101) with quotes
- CSV to Associative Array
- Create a comma-separated string from a single column of an array of objects
- Isolate comma-separated values, remove duplicates and empty values, then sort
- PHP multidimensional array search by value
- How to sum all column values in multi-dimensional array?
- How to convert JSON string to array
- Modify array values in foreach loop
- Build a tree from a flat array in PHP
- PHP sort array by two field values [duplicate]
- Cartesian Product of N arrays
- Foreach loop inside array
- Create new variables from array keys in PHP
- Sort an array by a child array’s value in PHP
- Convert flat array to the multi-dimensional
- Fastest way to add prefix to array keys?
- PHP order array by date? [duplicate]
- Is there a way to fetch associative array grouped by the values of a specified column with PDO?
- Using usort in php with a class private function
- php – get numeric index of associative array
- Using array_intersect on a multi-dimensional array
- Converting an array from one to multi-dimensional based on parent ID values
- Check whether an array is empty [duplicate]
- PHP: Split string into array, like explode with no delimiter
- Get most recent date from an array of dates in “Y-m-d H:i:s” format
- Push item to associative array in PHP
- PHP Spread Syntax in Array Declaration