What are best practices for handling password encryption, such as using md5 in PHP?
When handling password encryption in PHP, it is best practice to use stronger encryption algorithms like bcrypt or Argon2 instead of md5, as md5 is considered outdated and insecure for password hashing. These algorithms provide better security against brute force attacks and rainbow table attacks.
```php
// Using bcrypt for password hashing
$password = "password123";
$hashedPassword = password_hash($password, PASSWORD_BCRYPT);
```
Remember to store the hashed password securely in your database and always use the `password_verify()` function to compare user input passwords with the stored hashed password.