How can PHP developers improve the readability and maintainability of their code by incorporating whitespace and formatting conventions, as demonstrated in the example script?

To improve the readability and maintainability of PHP code, developers can incorporate whitespace and formatting conventions such as consistent indentation, line breaks between logical sections, and clear naming conventions. This makes the code easier to follow and understand for both the developer and others who may need to work on it in the future.

<?php

// Example script with improved readability and maintainability

function calculate_total($price, $quantity) {
    $total = $price * $quantity;

    return $total;
}

$price = 10;
$quantity = 5;

$total = calculate_total($price, $quantity);

echo "Total: " . $total;

?>