2 namespace TYPO3\CMS\Core\Utility;
33 public static function csvToArray($input, $fieldDelimiter =
',', $fieldEnclosure =
'"', $maximumColumns = 0)
35 $multiArray = array();
36 $maximumCellCount = 0;
38 if (($handle = fopen(
'php://memory',
'r+')) !==
false) {
39 fwrite($handle, $input);
41 while (($cells = fgetcsv($handle, 0, $fieldDelimiter, $fieldEnclosure)) !==
false) {
42 $maximumCellCount = max(count($cells), $maximumCellCount);
43 $multiArray[] = $cells;
48 if ($maximumColumns > $maximumCellCount) {
49 $maximumCellCount = $maximumColumns;
52 foreach ($multiArray as &$row) {
53 for ($key = 0; $key < $maximumCellCount; $key++) {
56 && $maximumColumns < $maximumCellCount
57 && $key >= $maximumColumns
59 if (isset($row[$key])) {
62 }
elseif (!isset($row[$key])) {