PHP code example of hi-folks / rando-php

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

    

hi-folks / rando-php example snippets


use HiFolks\RandoPhp\Randomize;

Randomize::char()->numeric()->generate();

Randomize::char()->alpha()->generate();

Randomize::char()->alphanumeric()->generate();

Randomize::char()->alpha()->lower()->generate();

Randomize::char()->alpha()->upper()->generate();

Randomize::char()->specialCharacters()->generate();

$randomFloat = Randomize::float()->generate();

$randomFloat = Randomize::float()->min(0)->max(90)->generate();

$randomRGB = Randomize::byte()->length(3)->generate();

$randomDate = Randomize::datetime()->generate();

$randomDate = Randomize::datetime()->min('2020–01–01')->max('2020–01–10')->generate();

$randomDate = Randomize::datetime()->format('d-M-Y')->generate();

$randomDate = Randomize::datetime()->min('2020–01–01')->max('2020–01–10')->format('d-M-Y')->generate();

$randomRolls = Randomize::sequence()->min(1)->max(6)->count(15)->generate();

$randomChars = Randomize::sequence()->chars()->count(10)->generate();

$randomChars = Randomize::sequence()->chars()->numeric()->count(10)->generate();

$randomChars = Randomize::sequence()->chars()->alpha()->count(10)->generate();

$randomChars = Randomize::sequence()->chars()->alphanumeric()->count(10)->generate();

Randomize::sequence()->chars()->alphaLowerCase()->count(20)->asString()->generate();

Randomize::sequence()->chars()->alphaUpperCase()->count(20)->asString()->generate();

$randomTombola = Randomize::sequence()->min(1)->max(90)->count(90)->noDuplicates()->generate();

$randomChars = Randomize::sequence()->chars()->count(10)->noDuplicates()->generate();

$randomChars = Randomize::sequence()->chars()->numeric()->count(10)->noDuplicates()->generate();

$randomChars = Randomize::sequence()->chars()->alpha()->count(10)->noDuplicates()->generate();

$randomChars = Randomize::sequence()->chars()->alphanumeric()->count(10)->noDuplicates()->generate();

$string = Randomize::chars()->generate();

$string = Randomize::chars(16)->numeric()->generate();

$string = Randomize::chars(20)->alphaLowerCase()->unique()->generate();

$string = Randomize::chars(20)->specialCharacters()->alpha()->generate();

use HiFolks\RandoPhp\Draw;

use HiFolks\RandoPhp\Draw;

$randomLanguage = Draw::sample(["PHP", "Python", "Golang", "Javascript"])->snap();
var_dump($randomLanguage);

$array=["React.js", "Vue.js", "Svelte.js", "Angular.js" , "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->extract();

$array=["React.js", "Vue.js", "Svelte.js", "Angular.js" , "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->count(3)->extract();

$array = ["React.js", "Vue.js", "Svelte.js", "Angular.js", "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->count(3)->allowDuplicates()->extract();