convert a 2d array into a csv file in php
I'm try to convert a 2d array into a csv . but i got error
array to string conversion in line 7
here is my code
<?php
$export_arr =$_POST['dataString'];
$fp = fopen('file.xls', 'w');
foreach ( $export_arr as $line ) {
//$val = explode(",", $line);
fputcsv($fp, $export_arr);
}
fclose($fp);
?>
any ideas
No comments:
Post a Comment