OK, this is what I need :
I have an array with data and I need to convert it to a CSV string which can then be passed to CodeIgniter's force_download
download function.
I know of PHP's built-in function fputcsv
, but I now need to store the whole thing to a string (preferably without first having to save it to a file). And, preferably without having to write any custom function for escaping characters, etc.
So, how can this be done? Any ideas?