What are the potential pitfalls of using mt_rand for generating random numbers in PHP?

One potential pitfall of using mt_rand for generating random numbers in PHP is that it may not be cryptographically secure, making it unsuitable for certain applications like generating secure tokens or passwords. To address this issue, you can use the random_int function in PHP, which provides a cryptographically secure way to generate random integers.

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