My question is about how to properly handle the following warning:
Warning: fputcsv() expects parameter 2 to be array, boolean given
The offending lines are:
foreach($participantInfo as $fields)
{
fputcsv($participantFile, $fields);
}
When I did a var_dump on $fields, I found two arrays as expected, but also a final bool(false). Other than this, the code works as expected. Is there an appropriate way to handle the final bool, or should I just suppress the function warnings?
This will remove all the entries eqal to FALSE from
$participantInfo, deeper dimensions wil be untouched as your array is multidimensional.