function PARSECREATORS::grabSurname in Bibliography Module 5
Same name and namespace in other branches
- 6.2 modules/bibtexParse/PARSECREATORS.php \PARSECREATORS::grabSurname()
- 6 bibtexParse/PARSECREATORS.php \PARSECREATORS::grabSurname()
- 7.3 plugins/biblio_style/bibtex/PARSECREATORS.php \PARSECREATORS::grabSurname()
- 7 modules/bibtexParse/PARSECREATORS.php \PARSECREATORS::grabSurname()
- 7.2 modules/bibtexParse/PARSECREATORS.php \PARSECREATORS::grabSurname()
1 call to PARSECREATORS::grabSurname()
- PARSECREATORS::parse in bibtexParse/
PARSECREATORS.php
File
- bibtexParse/
PARSECREATORS.php, line 122
Class
Code
function grabSurname($input) {
$surnameArray = split(" ", $input);
$noPrefix = $surname = FALSE;
foreach ($surnameArray as $value) {
$firstChar = substr($value, 0, 1);
if (!$noPrefix && ord($firstChar) >= 97 && ord($firstChar) <= 122) {
$prefix[] = $value;
}
else {
$surname[] = $value;
$noPrefix = TRUE;
}
}
if ($surname) {
$surname = join(" ", $surname);
}
if (isset($prefix)) {
$prefix = join(" ", $prefix);
return array(
$surname,
$prefix,
);
}
return array(
$surname,
FALSE,
);
}