<?php
-# This file generates what Excell refers to as "CSV" files. This format makes
-# little sense, and does not actually have anything to do with commas.
+# This program is in the public domain within the United States. Additionally,
+# we waive copyright and related rights in the work worldwide through the CC0
+# 1.0 Universal public domain dedication, which can be found at
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+# These functions redutrn a csv download which is hopefully easy to import into
+# Excell and LibreOffice Calc
# pass in a 2d array (array of rows) and it'll send it to the browser
# I can't figure out how to get multi-line fields to work, so this replaces newlines with 4 spaces.
if($first) {
$first = false;
} else {
- echo "\t";
+ echo ",";
}
echo '"' . str_replace("\n", " ", str_replace('"', '""', $el)) . '"';
}