Created
June 6, 2013 23:40
-
-
Save seanbuscay/ead93fac9b67db52070f to your computer and use it in GitHub Desktop.
write to csv file
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
<?php | |
$list = array ( | |
array('aaa', 'bbb', 'ccc', 'dddd'), | |
array('123', '456', '789'), | |
array('"aaa"', '"bbb"') | |
); | |
$fp = fopen('file.csv', 'w'); | |
foreach ($list as $fields) { | |
fputcsv($fp, $fields); | |
} | |
fclose($fp); | |
?> |
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
<?php | |
$list = array ( | |
array('aaa', 'bbb', 'ccc', 'dddd'), | |
array('123', '456', '789'), | |
array('"aaa"', '"bbb"') | |
); | |
$fp = fopen('file.csv', 'w'); | |
foreach ($list as $fields) { | |
fputcsv($fp, $fields); | |
} | |
fclose($fp); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment