library human-name-parser
Parses a human name
davidgorges/human-name-parser
Parses a human name
- Tuesday, June 21, 2016
- by dgorges
- Repository
- 1 Watchers
- 11 Stars
- 25,500 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 39 Forks
- 0 Open issues
- 3 Versions
- 9 % Grown
, (*1)
Note: The 1.0 release requires PHP > 7.1., (*2)
Description
Fork from HumanNameParser.php origninally by Jason Priem jason@jasonpriem.com. Takes human names of arbitrary complexity and various wacky formats like:, (*3)
- J. Walter Weatherman
- de la Cruz, Ana M.
- James C. ('Jimmy') O'Dell, Jr.
- Dr. James C. ('Jimmy') O'Dell, Jr.
and parses out the:, (*4)
- leading initial (Like "J." in "J. Walter Weatherman")
- first name (or first initial in a name like 'R. Crumb')
- nicknames (like "Jimmy" in "James C. ('Jimmy') O'Dell, Jr.")
- middle names
- last name (including compound ones like "van der Sar' and "Ortega y Gasset"), and
- suffix (like 'Jr.', 'III')
- title (like 'Dr.', 'Prof') new
How to use
use HumanNameParser\Parser;
$nameparser = new Parser();
$name = $nameparser->parse("Alfonso Ribeiro");
echo "Hello " . $name->getFirstName();
dev-master
9999999-dev
Parses a human name
Sources
Download
MIT
The Requires
The Development Requires
by
David Gorges
0.2.1
0.2.1.0
Parses a human name
Sources
Download
MIT
The Requires
The Development Requires
by
David Gorges
0.1.0
0.1.0.0
Parses a human name
Sources
Download
MIT
The Development Requires
by
David Gorges