I an trying to export to a csv file the values of an array put I have the error
Warning: fputcsv() expects parameter 2 to be array, string given
the code is bellow ,What I can do to solve it?
foreach ($array[$domain_id][$pr[1]] as $arr)
{
$insert[ ] ="Some text from $array";
}
$fp = fopen('mart.csv', 'w');
foreach ($insert as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
[edit]
I set the code bellow and I solved it.
$insert[ ] = array('select'=>"Some text from $array");