PHP code example of bfrohs / random

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

    

bfrohs / random example snippets


use bfrohs\Random\Random;

$string = Random::generateHex(32);

var_dump($string);

use bfrohs\Random\Random;

$string = Random::generateUrlSafeString(32);

var_dump($string);

use bfrohs\Random\Random;

$string = Random::generateBinary(32);

// Note the use of `bin2hex()` to make output readable
var_dump(bin2hex($string));

use bfrohs\Random\Random;

$string = Random::generateInt(0, 29524);

var_dump($string);