What is the purpose of using MD5 encryption in PHP?

MD5 encryption in PHP is commonly used to hash passwords or sensitive data before storing them in a database. This helps to protect the data from being easily read in case of a security breach. MD5 encryption converts the input data into a fixed-length hash value, making it difficult for attackers to reverse engineer the original data.

$password = "secret_password";
$hashed_password = md5($password);
echo $hashed_password;