Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create function to write single CSV line
  • Loading branch information
vinivf committed May 24, 2016
commit 81e854f74c0dbdadd34a2123c14ffe700c76611b
12 changes: 12 additions & 0 deletions xlsxwriter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,18 @@ public function writeCSV(array $data, array $header_types=array(), $delimiter =
return $output;
}

public function writeCSVLine(array $data, $type = null, $delimiter = ';') {
if (!empty($type)) {
$text = array_keys($data);
} else {
$text = $data;
}

$output = '';
$output .= implode($delimiter, $text) . "\n";
return $output;
}

public function writeSheet(array $data, $sheet_name='', array $header_types=array() )
{
$sheet_name = empty($sheet_name) ? 'Sheet1' : $sheet_name;
Expand Down