2017 © Pedro Peláez
 

library human-name-parser

A human name parser written in PHP.

image

chrisullyott/human-name-parser

A human name parser written in PHP.

  • Thursday, June 7, 2018
  • by chrisullyott
  • Repository
  • 1 Watchers
  • 1 Stars
  • 721 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 266 % Grown

The README.md

human-name-parser

Latest Stable Version Total Downloads, (*1)

A human name parser written in PHP., (*2)

Based on Josh Fraser's PHP-Name-Parser. I attempted to rewrite the library to be more easily understandable (at least to myself). Nearly all the original features are maintained., (*3)

The algorithm first sanitizes a name string, and then breaks it into smaller pieces using a library of professional titles and suffixes., (*4)

Installation

Include in your project, or, install with Composer:, (*5)

$ composer require chrisullyott/human-name-parser

Parsing a name

use ChrisUllyott\HumanNameParser;

$parser = new HumanNameParser('Dr. martin luther king jr');
print_r($parser->parse());
Array
(
    [full]       => Dr. Martin Luther King Jr.
    [salutation] => Dr.
    [first]      => Martin
    [middle]     => Luther
    [last]       => King
    [suffix]     => Jr.
)

Methods

Name Sample output
getFullName() Dr. Martin Luther King Jr.
getSalutation() Dr.
getFirstName() Martin
getMiddleName() Luther
getLastName() King
getSuffix() Jr.

The Versions

07/06 2018

dev-master

9999999-dev https://github.com/chrisullyott/human-name-parser

A human name parser written in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

21/04 2018

dev-dev

dev-dev https://github.com/chrisullyott/human-name-parser

A human name parser written in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

27/03 2018

1.0.1

1.0.1.0 https://github.com/chrisullyott/human-name-parser

A human name parser written in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

23/03 2018

1.0

1.0.0.0 https://github.com/chrisullyott/human-name-parser

A human name parser written in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires