Why is bcrypt considered better than MD5 for password hashing in PHP?

bcrypt is considered better than MD5 for password hashing in PHP because it is a more secure algorithm that is specifically designed for securely hashing passwords. MD5 is a fast hashing algorithm that is no longer considered secure for password hashing due to its vulnerability to brute force attacks and rainbow table attacks. bcrypt, on the other hand, is a slow hashing algorithm that is resistant to these types of attacks, making it a more secure choice for storing passwords.

$password = "password123";
$hashed_password = password_hash($password, PASSWORD_BCRYPT);