PHP code example of uksarkar / petname-generator

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

    

uksarkar / petname-generator example snippets




etNameGenerator\PetNameGenerator;

echo PetNameGenerator::generate(); // e.g., "panda"



use PetNameGenerator\PetNameGenerator;

// Generate a name with 3 words, separated by a dash
echo PetNameGenerator::generate(3, '-'); // e.g., "merrily-bouncy-tiger"

// Generate a name with 4 words, separated by an underscore
echo PetNameGenerator::generate(4, '_'); // e.g., "quickly_silly_fox_brave"