PHP code example of raicem / turkish-name-parser

1. Go to this page and download the library: Download raicem/turkish-name-parser 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/ */

    

raicem / turkish-name-parser example snippets


use Raicem\NameParser;

$parser = new NameParser;
$name = $parser->parse('Ahmet Yılmaz');

// test weather the name was valid
$name->isValid();

// get the result as array
$name->asArray();

// get the result as string;
$name->asString();

// toString allows you to get the string as well
echo $name

// you can see whichs parts are invalid
$name->getInvalidChunks();