Afficher la zone de texte

random_bytes()

« rand | range »
<?php
$string 
random_bytes (
    
  // int $length
);

// shows the result in hexadecimal
if ($string) {
    
$hex bin2hex($string);
}
?>
Résultat
$string = 'B '
$hex = 'a542b90ce9'
Exemples
#1 random_bytes  (5)
Voir aussi
bin2hex, openssl_random_pseudo_bytes