This will create the letters in Column A, and Numbers in Column B.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php $list = array('aaa', 'bbb', 'ccc', 'dddd'); $numbers = array('111', '2222', '3333', '4444'); $fp = fopen('data.csv', 'w'); for ($i = 0; $i < count($list); $i++) { $fields = array($list[$i], $numbers[$i]); fputcsv($fp, $fields); } fputcsv($fp, $fields); fclose($fp); ?> |