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!










echothe output afterfclose($fp);echoinganything thus the page will be blank only. It will just create csv for you as per your code.