Generate CSV file from a PHP array
From http://designzum.com/2014/03/13/9-most-useful-php-code-snippets-for-developers/