You are here

function _grabSurname in Bibliography Module 5

Same name and namespace in other branches
  1. 6 biblio.contributors.inc \_grabSurname()
  2. 7 includes/biblio.contributors.inc \_grabSurname()
  3. 7.2 includes/biblio.contributors.inc \_grabSurname()
1 call to _grabSurname()
_parse_author_array in ./biblio.module

File

./biblio.module, line 3361

Code

function _grabSurname($input) {
  $surnameArray = split(" ", $input);
  foreach ($surnameArray as $value) {
    $firstChar = substr($value, 0, 1);
    if (ord($firstChar) >= 97 && ord($firstChar) <= 122) {
      $prefix[] = $value;
    }
    else {
      $surname[] = $value;
    }
  }
  if (isset($surname)) {
    $surname = join(" ", $surname);
  }
  if (isset($prefix)) {
    $prefix = join(" ", $prefix);
    return array(
      $surname,
      $prefix,
    );
  }
  return array(
    $surname,
    FALSE,
  );
}