PHP code example of adt / full-name-analyser

1. Go to this page and download the library: Download adt/full-name-analyser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adt / full-name-analyser example snippets


$result = (new FullNameAnalyser('cs', 'CZ', \ADT\FullNameAnalyser\FullNameAnalyser::VOCATIVE_FORM_INFORMAL))->anylyse('prof. Ing. Tomáš Kudělka, Ph.D.');

$result->getTitleBefore(); // vrátí "prof. Ing."
$result->getFirstName(); // vrátí "Tomáš"
$result->getLastName(); // vrátí "Kudělka"
$result->getTitleAfter(); // vrátí "Ph.D."
$result->getGender(); // vrátí "male" (alternativně "female")
$result->getVocative(); // vrátí "Tomáši" (alternativně "profesore")