What are the potential risks of using plain text passwords in PHP applications?

Storing passwords in plain text in PHP applications poses a significant security risk as it exposes user credentials to potential attackers in case of a data breach. To mitigate this risk, passwords should be securely hashed using algorithms like bcrypt before storing them in the database.

// Hashing a password using bcrypt
$password = "secret_password";
$hashed_password = password_hash($password, PASSWORD_BCRYPT);