diff options
Diffstat (limited to 'examples/download.php')
-rw-r--r-- | examples/download.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/download.php b/examples/download.php new file mode 100644 index 0000000..3e017b6 --- /dev/null +++ b/examples/download.php @@ -0,0 +1,11 @@ +<?php + +use Bakame\Csv\Reader; + +require '../vendor/autoload.php'; + +$inputCsv = new Reader('data/prenoms.csv'); +$inputCsv->setEncoding('ISO-8859-15'); +header('Content-Type: text/csv; charset="'.$inputCsv->getEncoding().'"'); +header('Content-Disposition: attachment; filename="firstname.csv"'); +$inputCsv->output(); |