Skip to content

Commit

Permalink
fixed Format::to_csv() incorrectly formatting the column headers
Browse files Browse the repository at this point in the history
  • Loading branch information
WanWizard committed May 23, 2012
1 parent 1dd3249 commit f48ffcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/format.php
Expand Up @@ -213,15 +213,15 @@ public function to_csv($data = null, $separator = ',')
$headings = array_shift($data);
}
}

// Single array
else
{
$headings = array_keys((array) $data);
$data = array($data);
}

$output = implode('"' . $separator . '"', $headings) . "\"\n";
$output = "\"".implode('"' . $separator . '"', $headings) . "\"\n";

foreach ($data as &$row)
{
$output .= '"' . implode('"' . $separator . '"', (array) $row) . "\"\n";
Expand Down

0 comments on commit f48ffcb

Please sign in to comment.