I have a form and I want to write the contents to a CSV file.
$fp is the file to write to.
$v are the values in the array $_POST.
foreach ($_POST as $i=>$v){
fputcsv($fp, $v);
}
I get this error message:
Warning: fputcsv() expects parameter 2 to be array, string given in .....
I think this must be very basic but I have not found any resource on the web identical to my question. Lots on arrays but not this particular question. The manual on fputcsv went into more complicated matters.
I can print out the array $_POST so I know there are values there.
I would appreciate any help you may give.