Exporting to CSV on Mac's Excel using PHP's fgetcsv

PHP has a nice way of working with CSV files using the fgetcsv function. One of the downfalls in using the CSV format is dealing with what character is used for new lines, which is how nearly all CSV files determine the separation of rows.

If you are using excel on Mac and do not want to set your own newline character in PHP (or don’t have access to it!), when you save the file, choose Windows Comma Seperated (.csv) as the file type.