Is SHA1 a more secure option than MD5 for password encryption in PHP?
While SHA1 is more secure than MD5, it is still considered weak for password encryption due to vulnerabilities such as collision attacks. It is recommended to use stronger hashing algorithms such as SHA-256 or SHA-512 for password encryption in PHP.
$password = "secretPassword";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);