Skip to content

Commit

Permalink
Escaping CSV Headings to fix the case of a heading including a comma
Browse files Browse the repository at this point in the history
  • Loading branch information
mohabusama committed May 27, 2013
1 parent def1295 commit b6a22cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/libraries/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function to_csv()
$data = array($data);
}

$output = implode(',', $headings).PHP_EOL;
$output = '"'.implode('","', $headings).'"'.PHP_EOL;
foreach ($data as &$row)
{
$output .= '"'.implode('","', $row).'"'.PHP_EOL;
Expand Down

0 comments on commit b6a22cc

Please sign in to comment.