PHP Class HumanNameParser_Parser, HumanNameParser.php

Example usage: $parser = new Parser("John Q. Smith"); echo $parser->getLast() . ", " . $parser->getFirst(); returns "Smith, John"
Mostra file Open project: jasonpriem/HumanNameParser.php Class Usage Examples

Public Methods

Method Description
__construct ( $name = NULL ) * Constructor
getArray ( String $arrType = 'assoc' ) : array returns all the parts of the name as an array
getFirst ( )
getLast ( )
getMiddle ( )
getName ( )
getNicknames ( )
getSuffix ( )
getleadingInit ( )
setName ( mixed $name = NULL ) Sets name string and parses it.

Private Methods

Method Description
parse ( ) * Parse the name into its constituent parts.

Method Details

__construct() public method

* Constructor
public __construct ( $name = NULL )
$name Either a name as a string or as a Name object.

getArray() public method

returns all the parts of the name as an array
public getArray ( String $arrType = 'assoc' ) : array
$arrType String pass 'int' to get an integer-indexed array (default is associative)
return array An array of the name-parts

getFirst() public method

public getFirst ( )

getLast() public method

public getLast ( )

getMiddle() public method

public getMiddle ( )

getName() public method

public getName ( )

getNicknames() public method

public getNicknames ( )

getSuffix() public method

public getSuffix ( )

getleadingInit() public method

public getleadingInit ( )

setName() public method

Takes Name object or a simple string (converts the string into a Name obj), parses and loads its constituant parts.
public setName ( mixed $name = NULL )
$name mixed Either a name as a string or as a Name object.