PHP code example of gildrd / name-generator

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

    

gildrd / name-generator example snippets


$nameGenerator = new NameGenerator(Type::FEMALE_40K_HIGHER_GOTHIC, Type::FEMALE_40K_LOWER_GOTHIC);
$name = $nameGenerator->generate();

$nameGenerator = new NameGenerator(Type::MALE_40K_ARCHAIC);
$parameter = new Parameter();
$parameter->setLetterInTriple(false)
    ->setMinLength(5)
    ->setMaxLength(9)
    ->setNoVowelsInName(false);
$nameGenerator->setParameter($parameter);
$name = $nameGenerator->generate();