I create a CSV file to be downloaded by our client using
$output = fopen('php://output', 'w');
and using fputcsv() to write data to a CSV file that is downloaded by the client.
I am running PHP on Linux, and therefore line endings are not interpreted by many Windows applications.
I could write the CSV file to a directory on the server, read it and execute str_replace() from \n to \r\n , but this seems like a pretty awkward way to solve the problem. Is there a way to perform the conversion without creating a physical file?
Kalessin
source share