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

The issue with the provided code is that it lacks proper indentation and comments, making it difficult to read and maintain. To enhance code readability and maintainability, we can improve the indentation, add comments to explain the purpose of each section of code, and use meaningful variable names.

// Define a function to calculate the factorial of a number
function factorial($n) {
    if ($n <= 1) {
        return 1;
    } else {
        return $n * factorial($n - 1);
    }
}

// Calculate and display the factorial of 5
$number = 5;
$result = factorial($number);
echo "Factorial of $number is $result";