How does the use of "md5" for password hashing in PHP affect security, and what are the recommended best practices for password security in PHP?
Using "md5" for password hashing in PHP is not recommended for security purposes as it is considered outdated and vulnerable to attacks like rainbow tables. Instead, it is recommended to use more secure hashing algorithms like bcrypt or Argon2. Additionally, using techniques like salting and key stretching can further enhance password security in PHP.
// Recommended best practice for password security in PHP
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
// $password is the user's input password
// Store $hashed_password in the database