générateur de nombres aléatoires en php
you can use rand() function for that in php.
Example:
Generate random numbers between 1 to 50
<?php
echo rand(1,50);
?>
php chaîne aléatoire
function rand_str() {
$characters = '0123456789-=+{}[]:;@#~.?/>,<|\!"£$%^&*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomstr = '';
for ($i = 0; $i < random_int(50, 100); $i++) {
$randomstr .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomstr;
}
générateur de nombres aléatoires php
<?php
echo rand(1,50);
?>
php rand int
random_int ( int $min , int $max );
php entier aléatoire
echo random_int(0,50);
php nombre aléatoire
rand(0,10);
or
random_int(0,10)
php aléatoire
mt_rand(1000, 9999)