Created
September 26, 2015 20:21
-
-
Save anonymous/223ea7353626bc6a6a9e to your computer and use it in GitHub Desktop.
This file contains 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 csvPutEnclosed($file, $entries) { | |
$fp = fopen($file, 'a+'); | |
foreach($entries as $entry) { | |
fputcsv($fp, array_map(function($v) { return "\"".str_replace('"', '\"', $v)."\"";}, $entry), ',', chr(0)); | |
} | |
fclose($fp); | |
file_put_contents($file, str_replace(chr(0), '', file_get_contents($file))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much for your efforts