Пример #1
0
 /**
  * Returns the formated author name as "LastName, FirstName".
  */
 function formatAuthorCommaSeparated($author)
 {
     list($firstname, $lastname) = splitFullName($author);
     if ($firstname != '') {
         return $lastname . ', ' . $firstname;
     } else {
         return $lastname;
     }
 }
 /**
  * Returns the formated author name as "LastName Initials".
  * e.g. for Vancouver-style used by PubMed.
  */
 function formatAuthorInitials($author)
 {
     list($firstname, $lastname) = splitFullName($author);
     if ($firstname != '') {
         return $lastname . ' ' . preg_replace("/(\\p{Lu})\\w*[- ]*/Su", "\$1", $firstname);
     } else {
         return $lastname;
     }
 }
Пример #3
0
 /**
  * Returns the formated author name as "LastName, FirstName".
  */
 function formatAuthorCommaSeparated($author)
 {
     list($firstname, $lastname) = splitFullName($author);
     if ($firstname != '' && substr($firstname, -1) != '.') {
         $firstname = substr($firstname, 0, 1) . '.';
     }
     if ($firstname != '') {
         return $lastname . ', ' . $firstname;
     } else {
         return $lastname;
     }
 }