In what ways can the lack of proper code formatting and structure affect the readability and maintainability of PHP code?

Lack of proper code formatting and structure can make PHP code difficult to read and maintain. It can lead to confusion about the logic flow, variable names, and overall structure of the codebase. To improve readability and maintainability, it's important to follow a consistent coding style, use meaningful variable names, and properly indent the code.

// Properly formatted and structured PHP code snippet
<?php

function calculateTotal($price, $quantity) {
    $total = $price * $quantity;
    
    return $total;
}

$price = 10;
$quantity = 5;
$total = calculateTotal($price, $quantity);

echo "Total: $" . $total;

?>