How can PHP be used to automate login processes across multiple devices?

Issue: PHP can be used to automate login processes across multiple devices by creating a centralized authentication system that stores user credentials securely and allows users to log in from any device with a single set of credentials.

<?php

// Centralized authentication system
function authenticateUser($username, $password) {
    // Check if username and password are valid
    if ($username === 'admin' && $password === 'password123') {
        return true;
    } else {
        return false;
    }
}

// Example usage
if (authenticateUser($_POST['username'], $_POST['password'])) {
    echo 'Login successful!';
} else {
    echo 'Invalid username or password';
}

?>