What are the potential security risks associated with using the md5() function for password hashing in PHP?

Using the md5() function for password hashing in PHP is not secure because it is considered to be a weak hashing algorithm that is vulnerable to brute force attacks and collisions. It is recommended to use stronger hashing algorithms like bcrypt or Argon2 for secure password hashing in PHP.

// Using bcrypt for secure password hashing
$hashed_password = password_hash($password, PASSWORD_BCRYPT);