I want to make a CSV file, however, when I run the code, all that is produced is a blank page. I employ PHP 5. I employ the code below:
<?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);
?>
Can someone please help me with this?