Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?

Your WordPress code is correct, the problem is the incorrect 2nd param to PHP’s frwite(), which needs to be a string, and you’re passing arrays.

I think you want something like:

fwrite ($fp, "$label\n") ;
fwrite ($fp, implode (',', array_keys ($entries)) . "\n") ;
fwrite ($fp, implode (',', array_values ($entries)) . "\n") ;