开发者

Create a CSV file with PHP

开发者 https://www.devze.com 2022-12-17 05:39 出处:网络
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 fu开发者_如何学JAVAnction exists for this kind of stuff but I can\'t find it nor

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 fu开发者_如何学JAVAnction 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.


fputcsv is to write an array into a file with CSV format. fgetcsv is to read data from a file with CSV format and convert it into an array. And str_getcsv is to convert a string in CSV format into an array.

So fputcsv and fgetcsv are their respective inverses. And fgetcsv could be a function that uses str_getcsv.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号