What PHP functions can be used to generate random passwords securely for user accounts?

Generating random passwords securely for user accounts is crucial for ensuring the security of user data. To achieve this, PHP provides several functions that can be utilized. One common approach is to use the `random_bytes()` function to generate cryptographically secure random bytes and then encode them using `base64_encode()` to create a random password.

$password = base64_encode(random_bytes(10));