Created
April 26, 2017 12:54
-
-
Save chupzzz/b8d25da82e562912d486df2862f23151 to your computer and use it in GitHub Desktop.
Convert array to CSV and return it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function array2csv($array) { | |
$csv = fopen('php://temp/maxmemory:'. (5*1024*1024), 'r+'); | |
fputcsv($csv, $array, ';'); | |
rewind($csv); | |
return stream_get_contents($csv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment