PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Peter Kahl   Name String Order   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Name String Order
Get person name and surname from a string
Author: By
Last change: Update of README.md
Date: 4 years ago
Size: 1,558 bytes
 

Contents

Class file image Download

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