What are the advantages of using functions in PHP scripts, even if they are only used once?

Using functions in PHP scripts, even if they are only used once, can help improve code organization, readability, and reusability. Functions allow you to encapsulate a specific block of code, making it easier to understand and maintain. Additionally, functions can be easily reused in different parts of the script or even in other scripts, promoting code reusability and reducing redundancy.

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

$total = calculateTotal(10, 5);
echo "Total: $" . $total;