Are there best practices for increasing the security of password hashing in PHP beyond using md5?

Using md5 for password hashing in PHP is not secure enough because it is a fast hashing algorithm that can be easily cracked using modern hardware. To increase the security of password hashing, it is recommended to use stronger hashing algorithms like bcrypt or Argon2, along with salting the passwords to add an extra layer of security.

// Using bcrypt for password hashing with salt
$password = "password123";
$salt = uniqid(mt_rand(), true);
$hashed_password = password_hash($password . $salt, PASSWORD_BCRYPT);

// Verifying password
$user_input = "password123";
if (password_verify($user_input . $salt, $hashed_password)) {
    echo "Password is correct";
} else {
    echo "Password is incorrect";
}