function biblio_implode_keywords in Bibliography Module 7
Same name and namespace in other branches
- 6.2 includes/biblio.keywords.inc \biblio_implode_keywords()
- 6 biblio.keywords.inc \biblio_implode_keywords()
- 7.2 includes/biblio.keywords.inc \biblio_implode_keywords()
Parameters
iterable $keywords:
string $sep:
Return value
string
1 call to biblio_implode_keywords()
- biblio_form in ./
biblio.module - Implements hook_form().
File
- includes/
biblio.keywords.inc, line 451 - Contains all keyword related functions.
Code
function biblio_implode_keywords($keywords, $sep = '') {
if (empty($sep)) {
$sep = variable_get('biblio_keyword_sep', ',');
}
$string = '';
foreach ($keywords as $kid => $keyword) {
$string .= strlen($string) ? "{$sep} " : '';
if (strpos($keyword, $sep) !== FALSE) {
$string .= '"' . $keyword . '"';
}
else {
$string .= $keyword;
}
}
return $string;
}