PHP code example of rodrigoq / phpnetrandom

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

    

rodrigoq / phpnetrandom example snippets






etRandom\NetRandom;

$random = new NetRandom(); //seed is optional.

// You can add max or, min and max parameters.
echo $random->Next() . PHP_EOL;

echo $random->NextDouble() . PHP_EOL;

$bytes = array_fill(0, 10, 0);
$random->NextBytes($bytes);
var_dump($bytes);