English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Lerand()
La fonction obtient un nombre aléatoire. Vous pouvez également définir une plage pour obtenir un nombre aléatoire à partir de cette plage spécifique.
rand(); ou rand(min_range,max_range);
min_range-Par défaut, il est de 0. C'est le nombre le plus bas à retourner.
max_range-C'est le nombre le plus élevé à retourner.
Lerand()
La fonction retourne un entier aléatoire entre min_range et max_range.
<?php echo(rand() . "<br>"); echo(rand() . "<br>"); echo(rand() . "<br>"); echo(rand() . "<br>"); echo(rand() . "<br>"); echo(rand()); ?>
Résultat de la sortie
1581227270<br>1094001227<br>306337052<br>151211887<br>7894804<br>115835633
Voyons un autre exemple-
<?php echo(rand(2, 5)) . "<br>"; echo(rand(90, 190)); ?>
Résultat de la sortie
4<br>114