first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace Export;
/**
* ExportDataCSV - Exports to CSV (comma separated value) format.
*/
class ExportDataCSV extends ExportData
{
public function generateRow($row)
{
foreach ($row as $key => $value) {
// Escape inner quotes and wrap all contents in new quotes.
// Note that we are using \" to escape double quote not ""
$row[$key] = '"'.str_replace('"', '\"', $value).'"';
}
return implode(',', $row)."\n";
}
public function sendHttpHeaders()
{
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename='.basename($this->filename));
}
}