Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2019-10-14 (2 hours ago) | | 54% | | Total: 191 | | All time: 8,318 This week: 346 |
|
Description | | Author |
This class can get person name and surname from a string.
It can take a string with the name of a person and attempts to detect the actual name by the right order.
The class can return the person first name, last name, or the complete name first with the first name or the last name. Innovation Award
April 2017
Number 7 |
The name of a person can be represented in different ways in different places. Sometimes the surname appears first, others times it appears last.
This class can take a look at a string with a person name and detect if the surname comes first or last. Then it can reformat the name according to whatever order is preferred in your PHP application.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 23x
Winner: 2x |
|
Details
Name String Order
Attempts to order a person's name as 'First Last', 'First Middle Last', 'Last First', and extracts 'First', 'Last' and 'Middle'.
Usage
Romanized Chinese name:
use peterkahl\nameStringOrder\nameStringOrder;
$nameObj = new nameStringOrder('WANG jing-jing');
echo $nameObj->getFirstLast(); # Jing-Jing Wang
echo $nameObj->getLastFirst(); # Wang Jing-Jing
echo $nameObj->getFirst(); # Jing-Jing
echo $nameObj->getLast(); # Wang
Russian name:
use peterkahl\nameStringOrder\nameStringOrder;
$nameObj = new nameStringOrder('???????? ???????????? ?????');
echo $nameObj->getFirstLast(); # ???????? ?????
echo $nameObj->getLastFirst(); # ????? ????????
echo $nameObj->getFirstMiddleLast(); # ???????? ???????????? ?????
echo $nameObj->getFirst(); # ????????
echo $nameObj->getMiddle(); # ????????????
echo $nameObj->getLast(); # ?????
Chinese name:
use peterkahl\nameStringOrder\nameStringOrder;
$nameObj = new nameStringOrder('???');
echo $nameObj->getFirst(); # ??
echo $nameObj->getLast(); # ?
Latin character name:
use peterkahl\nameStringOrder\nameStringOrder;
$nameObj = new nameStringOrder('Curie Marie');
echo $nameObj->getFirstLast(); # Marie Curie
echo $nameObj->getLastFirst(); # Curie Marie
echo $nameObj->getFirst(); # Marie
echo $nameObj->getLast(); # Curie
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.