PHP 8.0.26 Released!

Random\Randomizer::getBytes

(PHP 8 >= 8.2.0)

Random\Randomizer::getBytesGet random bytes

Description

public Random\Randomizer::getBytes(int $length): string

Warning

This function is currently not documented; only its argument list is available.

Parameters

length

The length of the random string that should be returned in bytes; must be 1 or greater.

Return Values

A string containing the requested number of random bytes.

Errors/Exceptions

Examples

Example #1 Random\Randomizer::getBytes() example

<?php

/* ... */

?>

The above example will output something similar to:

...

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top