PHP code example of alcea / php-password-generator

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

    

alcea / php-password-generator example snippets


composer 



use alcea\PhpPasswordGenerator\PhpPasswordGenerator;

that contains:
# between 4 and 7 uppercase letter,
# between 4 and 7 lowercase letter,
# between 1 and 5 numbers,
# between 1 and 5 special char,
echo $passwordObj->generate();

# password that contains 2 uppercase letter, 2 lowercase letter, 2 numbers and 1 special char in a random order
echo $passwordObj->generate(2, 2, 2, 1);

# password that contains 4 numbers
echo $passwordObj->generate(false, false, 4, false);

"alcea/php-password-generator": "^1.0"

## Open an terminal and run commands:
git clone https://github.com/alceanicu/php-password-generator.git
cd php-password-generator
composer install
./vendor/bin/phpunit --bootstrap ./vendor/autoload.php --testdox