PHP code example of takuya / php-random-string

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

    

takuya / php-random-string example snippets


use Takuya\RandomString\RandomString;
// use class
RandomString::gen();
RandomString::gen(20,RandomString::ALPHA_NUM);
RandomString::gen(20,RandomString::ALPHA);
RandomString::gen(20,RandomString::ALPHA|RandomString::SYMBOLS);
RandomString::gen(20,RandomString::LOWER|RandomString::SYMBOLS);
RandomString::gen(20,RandomString::UPPER|RandomString::NUMBER);
// use helper generates randomized ALPHA_NUM.
$str = random_string(20);
$str = random_string(10);

composer config repositories.'php-random-string' \
vcs https://github.com/takuya/php-random-string  
composer 

git clone https://github.com/takuya/php-random-string
cd php-cert-checker
composer install
vendor/bin/phpunit