How can you improve the readability and structure of the PHP code provided for better maintenance?

The provided PHP code lacks proper indentation and comments, making it difficult to read and maintain. To improve readability and structure, we can add indentation, comments, and separate sections of the code with blank lines to make it easier to follow.

<?php

// Retrieve user data from the database
$userData = getUserData($userId);

// Process user data
if ($userData) {
    // Display user information
    displayUserInfo($userData);
} else {
    echo "User not found.";
}

// Function to retrieve user data from the database
function getUserData($userId) {
    // Database query to retrieve user data
    // Return user data
}

// Function to display user information
function displayUserInfo($userData) {
    // Display user information
}

?>