What are the potential security risks associated with storing passwords in plain text in a PHP application?

Storing passwords in plain text in a PHP application poses a significant security risk as anyone with access to the database can easily view and misuse the passwords. To mitigate this risk, passwords should be securely hashed before storing them in the database. This way, even if the database is compromised, the actual passwords remain secure.

$password = "password123";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
// Store $hashed_password in the database instead of $password