What is the significance of using md5() function for password encryption in PHP?
Using the md5() function for password encryption in PHP is not recommended due to its vulnerability to brute force attacks and the availability of more secure hashing algorithms like bcrypt. To enhance security, it is advised to use the password_hash() function with the PASSWORD_DEFAULT algorithm, which automatically generates a secure salt and uses a strong hashing algorithm.
$password = "password123";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);