Generates cryptographically secure pseudo-random bytes
Syntax
random_bytes ( int $length ) : string
Parameters
length
The length of the random string that should be returned in bytes.
Return
Returns a string containing the requested number of cryptographically secure random bytes.
Examples
<? $length = 4; $return = random_bytes($length); $hexadecimal = bin2hex($return); echo $hexadecimal; ?>
53ec1e00