PHP code example of claudiodekker / word-generator

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

    

claudiodekker / word-generator example snippets




use ClaudioDekker\WordGenerator\Generator;

echo Generator::generate(); // Outputs 'autumn firefly', 'crimson meadow', etc.



use ClaudioDekker\WordGenerator\Generator;

echo Generator::generate('-'); // Outputs 'autumn-firefly', 'crimson-meadow', etc.



use ClaudioDekker\WordGenerator\Generator;

echo Generator::generate('-', 4); // Outputs 'crimson-autumn-wandering-firefly' etc.



use ClaudioDekker\WordGenerator\Generator;

$adjectives = ['adjective one', 'adjective two'];
$nouns = ['noun one', 'noun two'];

Generator::setWordLists($adjectives, $nouns);



use ClaudioDekker\WordGenerator\Words\Adjective;

$adjectives = ['adjective one', 'adjective two'];

Adjective::setWordList($adjectives);



use ClaudioDekker\WordGenerator\Words\Noun;

$nouns = ['noun one', 'noun two'];

Noun::setWordList($nouns);