Skip to content

Commit 2100efb

Browse files
committed
Update Format.php
Reverse previous change from chriskacerguis#235 breaking 2-dimensional array data for CSV ouput
1 parent 68e57d6 commit 2100efb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

application/libraries/Format.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,8 @@ public function to_csv()
209209
$output = '"'.implode('","', $headings).'"'.PHP_EOL;
210210
foreach ($data as &$row)
211211
{
212-
if (is_array($row)) {
213-
throw new Exception('Format class does not support multi-dimensional arrays');
214-
} else {
215-
$row = str_replace('"', '""', $row); // Escape dbl quotes per RFC 4180
216-
$output .= '"'.implode('","', $row).'"'.PHP_EOL;
217-
}
218-
212+
$row = str_replace('"', '""', $row); // Escape dbl quotes per RFC 4180
213+
$output .= '"'.implode('","', $row).'"'.PHP_EOL;
219214
}
220215

221216
return $output;

0 commit comments

Comments
 (0)