function biblio_csv_export in Bibliography Module 6
Same name and namespace in other branches
- 6.2 includes/biblio.import.export.inc \biblio_csv_export()
- 7 includes/biblio.import.export.inc \biblio_csv_export()
- 7.2 includes/biblio.import.export.inc \biblio_csv_export()
2 calls to biblio_csv_export()
File
- ./
biblio.import.export.inc, line 1297 - Functions that are used to import and export biblio data.
Code
function biblio_csv_export($results) {
$csv = '';
if (!is_array($results)) {
$result_array[] = (array) $results;
}
else {
$result_array = $results;
}
$fieldnames = null;
foreach ((array) $result_array as $rec) {
if (empty($fieldnames)) {
$fieldnames = array_keys($rec);
$csv .= biblio_strcsv($fieldnames);
}
$csv .= biblio_strcsv($rec);
}
return $csv;
}