What are the best practices for implementing multiple passwords for accessing a PHP website?

To implement multiple passwords for accessing a PHP website, you can create an array of valid passwords and check the input password against this array. This way, users can log in with any of the valid passwords. Here is a simple example of how to implement this:

<?php

// Array of valid passwords
$validPasswords = array('password1', 'password2', 'password3');

// Check if the input password is in the array of valid passwords
$inputPassword = $_POST['password']; // Assuming the password is submitted via a form
if (in_array($inputPassword, $validPasswords)) {
    // Password is valid, allow access
    echo 'Access granted!';
} else {
    // Password is not valid, deny access
    echo 'Access denied!';
}

?>