insert a 2d array into a csv file in php
I'm trying to insert the 2d array into a csv file
here is my code below
<?php
$export_arr =$_POST['dataString'];
$fp = fopen('file.xls', 'w');
foreach ($export_arr as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
?>
but the values are inserted in single row in csv file.
any ideas
No comments:
Post a Comment