Skip to content

Commit

Permalink
Create function to write single CSV line
Browse files Browse the repository at this point in the history
  • Loading branch information
vinivf committed May 24, 2016
1 parent d673cda commit 81e854f
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 81e854f

Please sign in to comment.