How can code structure affect readability and understanding in PHP?

Code structure can greatly affect readability and understanding in PHP. By organizing code into logical sections, using proper indentation, and following naming conventions, developers can make their code easier to read and maintain. Additionally, breaking down complex tasks into smaller, more manageable functions can improve code clarity and comprehension.

// Example of well-structured PHP code
function calculateTotal($price, $quantity) {
    return $price * $quantity;
}

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

echo "Total: $" . $total;