Question
Trying to create CSV for Mac using PHP
Hi all,
I have a data set and want to save as CSV download...
Basically it's working however my mac is not recognizing the /n (new lines)
Did I script this wrong?
Any ideas how to get this working on a mac?
Also when I look at the download file I do not see any line feed or chr(13) return characters....
foreach ($records as $record) {
$alldata .= $record['id'] . "," .$record['Name'] . "," .$record['Info'] . "\n";
}
$response = "data:text/csv;charset=utf-8,id,Name,Info\n";
$response .= $alldata;
echo '<a href="'.$response.'" download="test.csv">download</a>';
