// Assume $username is the user's entered username // and $password is the user's entered password // Establish a database connection $db = new PDO('mysql:host=localhost;dbname=my_database', 'username', 'password'); // Prepare a query to retrieve the user's password $query = $db->prepare('SELECT password FROM users WHERE username = ?'); // Execute the query with the user's entered username $query->execute([$username]); // Retrieve the user's password from the query result $user = $query->fetch(); $passwordHash = $user['password']; // Verify the user's entered password against the retrieved password if (password_verify($password, $passwordHash)) { // Passwords match, grant access to the site } else { // Passwords do not match, deny access }This example code would be found in a package library related to database access or user authentication. The code is using the PDO database connection and the password_verify function which are both provided by the PHP language itself.