In the provided PHP code, what improvements can be made to enhance code readability and maintainability?

The provided PHP code lacks proper indentation and comments, making it difficult to read and understand. To enhance code readability and maintainability, we can add comments to explain the purpose of each section of code and properly indent the code for better structure.

<?php

// Retrieve user input
$username = $_POST['username'];
$password = $_POST['password'];

// Validate user input
if (empty($username) || empty($password)) {
    echo "Username and password are required.";
    exit;
}

// Process user login
if ($username === 'admin' && $password === 'admin123') {
    echo "Login successful!";
} else {
    echo "Invalid username or password.";
}

?>