The following PHP source code shows that how to print random numbers within a range using a seed. It uses rand() function to return the random numbers within a predefined range. The srand() function is used to provide the seed or arbitrary int number.

The rand() is built in PHP function which is generally used to generate a random integer number with in a range of values i.e., it can generate a random integer value in the range [min, max].

This function is not very secure so it should not be used for cryptographic purposes. Your can consider using any of these functions if you need a cryptographically secure value random_int()random_bytes(), or openssl_random_pseudo_bytes() instead.

Note: The output of the code changes every time it is run because we provide a different seed every time by using srand(time()) function.

Samsung 34' Odyssey G5 Ultra-Wide Gaming Monitor
Elevate your gaming and productivity with the Samsung 34-Inch Ultra-Wide Monitor – immersive visuals, seamless performance, and stunning clarity!
View on Amazon

Output: