Created
February 4, 2016 04:57
-
-
Save howtomakeaturn/8f5dab81f2d11eb7e006 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recipientName() | |
{ | |
if($this->getRecipientFirstName() == '' && $this->getRecipientLastName() == ''){ | |
return ''; | |
} | |
if($this->getRecipientFirstName() == '' ){ | |
return $this->getRecipientLastName(); | |
} | |
if($this->getRecipientLastName() == '' ){ | |
return $this->getRecipientFirstName(); | |
} | |
if (preg_match('/[^\\p{Common}\\p{Latin}]/u', $this->getRecipientLastName() . $this->getRecipientFirstName())){ | |
return $this->getRecipientLastName() . $this->getRecipientFirstName(); | |
}else{ | |
return $this->getRecipientFirstName() . ', ' . $this->getRecipientLastName(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment