please I have the following array :
array(3) {
[0]=>
array(2) {
[0]=>
string(6) "lkjhgj"
[1]=>
string(16) "jhgjhg@jhgjj.com"
}
[1]=>
array(2) {
[0]=>
string(5) "hgjk,"
[1]=>
string(18) "kjhgfghj@dgdfg.com"
}
[2]=>
array(2) {
[0]=>
string(9) "dddd ffff"
[1]=>
string(13) "dddd@gmail.fr"
}
}
I want to put it into a csv file, so I've tried :
$fichier = 'file.csv';
$fp = fopen($fichier, 'w');
foreach ($list as $fields)
{
fputcsv($fp, $fields);
}
fclose($fp);
header( 'Content-Type: text/csv' );
header( 'Content-Disposition: attachment;filename='.$fichier);
But when I download the file I found it empty !
Please masters any idea ? Thanks in advance
PS : Permissions are 777