I need to create a CSV file from a PHP array, I’m aware of the fputcsv() function. I’ve a recollection that a better function exists for this kind of stuff but I can’t find it nor remember it’s name.
Does anyone know of such function or am I imagining?
I might be making some confusion with the fgetcsv() function and the str_getcsv() equivalent.
fputcsvis to write an array into a file with CSV format.fgetcsvis to read data from a file with CSV format and convert it into an array. Andstr_getcsvis to convert a string in CSV format into an array.So
fputcsvandfgetcsvare their respective inverses. Andfgetcsvcould be a function that usesstr_getcsv.