What are the potential pitfalls of using rand() in PHP for generating random numbers?

One potential pitfall of using rand() in PHP for generating random numbers is that it is not suitable for cryptographic purposes due to its predictability. To generate cryptographically secure random numbers, it is recommended to use the random_int() function instead. This function provides a more secure and unpredictable source of random numbers.

// Using random_int() for generating cryptographically secure random numbers
$randomNumber = random_int(1, 100);
echo $randomNumber;