最佳答案
I want to create a csv file, but when I run the code, it returns a blank page and no csv file. I use PHP 5. I use the following code:
<?php
$data = array ('aaa,bbb,ccc,dddd',
'123,456,789',
'"aaa","bbb"');
$fp = fopen('data.csv', 'w');
foreach($data as $line){
$val = explode(",",$line);
fputcsv($fp, $val);
}
fclose($fp);
?>
Thank you!