note 96299 modified in function.str-getcsv by danbrown
| From: | danbrown@php.net | Date: | Fri, 19 Feb 2010 17:20:41 +0000 |
| Subject: | note 96299 modified in function.str-getcsv by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166181@lists.php.net to get a copy of this message | ||
For multiline array, just use :
<?php
$csvData = file_get_contents($fileName);
$csvNumColumns = 22;
$csvDelim = ";";
$data = array_chunk(str_getcsv($csvData, $csvDelim), $csvNumColumns);
?>
--was--
For multiline array, just use :
$csvData = file_get_contents($fileName);
$csvNumColumns = 22;
$csvDelim = ";";
$data = array_chunk(str_getcsv($csvData, $csvDelim), $csvNumColumns);
http://php.net/manual/en/function.str-getcsv.php