I have an array in this format:

That I want to output to csv. The trouble I'm having is getting that array in the right format. When I do:
foreach ($array as $row) {
fputcsv($df, $row);
}
I only get the integer values. I am missing a column with the names like ACCESSORIES.
Here is the output:

But I want column A to have the names like ACCESSORIES and column B to have the values.