get_random_bytes($length)
Parameters:
$length (int) – Output length Returns:
A binary stream of random bytes or FALSE on failure Return type:
string
A convenience method for getting proper random bytes via mcrypt_create_iv(), /dev/urandom or openssl_random_pseudo_bytes() (in that order), if one of them is available.
Used for generating CSRF and XSS tokens.
Note The output is NOT guaranteed to be cryptographically secure, just the best attempt at that.