Skip to content

Commit

Permalink
Merge pull request #5 from ebanx/feature/new-csv-function
Browse files Browse the repository at this point in the history
Create function to write single CSV line
  • Loading branch information
vinivf committed May 24, 2016
2 parents d673cda + 81e854f commit c72c4af
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 c72c4af

Please sign in to comment.