Create a Random PHP Number

2228
8909
PHP function rand()
The rand() function is used in PHP to generate random integers. The rand() PHP function can also be used to generate random numbers within a certain range, such as numbers between 10 and 30. The uses of php rand() include:
  • To regenerate the password
  • For OTP code via SMS or email
  • and others
rand() Syntax and Examples
The syntax for using the PHP rand function is as follows: OR

Examples of use, 3 examples below The first rand function produces a random number between 10 and 30, the second between 1 and 1 million, and then the third without a specified maximum or minimum number

An example will appear like this:
23
860705
996074503

To make a random code with a combination of numbers, letters and characters you can try the code below Figure 10 and 30 are the number of random strings

An example will appear like this:
EaxRFbTjB4
uWu3Er5bsi
QgSvcd1s4g0l0NllUJg7KdvR0pdrIP
mK94WTJJIirtmbUVVvnAsqxG63NNin
LEAVE A COMMENT