/ Published in: PHP
Expand |
Embed | Plain Text
class Format { foreach ($arr as $v) { } } foreach ($arr as $v) { $lines[] = self::arr_to_csv_line($v); } } }
Comments
Subscribe to comments
You need to login to post a comment.

thanx a lot the code is clean and works fine!
If you want the column headings included, stick this in before line 15 (the final return statement):
array_unshift($lines, self::arr_to_csv_line(array_keys(array_shift($arr))));