How can proper indentation and code formatting improve the readability and maintainability of PHP code?

Proper indentation and code formatting improve the readability and maintainability of PHP code by making the code structure more visually clear and organized. This makes it easier for developers to understand the code, identify logical blocks, and follow the flow of the program. Consistent indentation also helps in debugging and maintaining the code in the future.

<?php

// Badly formatted code
function calculateTotal($price, $quantity){
$total = $price * $quantity;
return $total;
}

// Properly formatted code
function calculateTotal($price, $quantity) {
    $total = $price * $quantity;
    return $total;
}

?>