What are the potential security risks associated with storing passwords in plain text or using weak encryption methods in PHP?

Storing passwords in plain text or using weak encryption methods in PHP can expose sensitive user information to potential security breaches. To mitigate this risk, passwords should be securely hashed using strong encryption algorithms like bcrypt before storing them in a database.

// Hashing a password using bcrypt
$password = "mySecurePassword";
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);