outputcsv : Allow multidimensionnal arrays
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4847 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -28,7 +28,10 @@ class outputcsv extends output
|
|||||||
@header ("Content-Type: text/csv");
|
@header ("Content-Type: text/csv");
|
||||||
// TODO : return $csv
|
// TODO : return $csv
|
||||||
$out = fopen ('php://output', 'w');
|
$out = fopen ('php://output', 'w');
|
||||||
fputcsv ($out, $data);
|
if (! is_array ($data[0]))
|
||||||
|
$data = array ($data);
|
||||||
|
foreach ($data as $vals)
|
||||||
|
fputcsv ($out, $vals);
|
||||||
fclose ($out);
|
fclose ($out);
|
||||||
if (!defined ("PHPUNIT"))
|
if (!defined ("PHPUNIT"))
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user