(PHP 8 >= 8.2.0)
Random\Randomizer::shuffleBytes — Get a byte-wise permutation of a string
$bytes
): string
Returns a uniformly selected permutation of the input bytes
.
Each possible permutation of the input bytes
is equally likely to be returned.
A permutation of the bytes of bytes
.
Random\Randomizer::$engine
ausgelöst werden.
Beispiel #1 Random\Randomizer::shuffleBytes() example
<?php
$r = new \Random\Randomizer();
// Shuffle bytes in a string:
echo '«', $r->shuffleBytes( "PHP is great!" ), "»\n";
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
« ga rHs!PPiet»