How can the use of comments in PHP code improve code readability and maintenance over time?

Using comments in PHP code can improve code readability and maintenance over time by providing explanations for complex logic, documenting the purpose of functions or variables, and outlining the overall structure of the code. Comments can help developers understand the code more easily, making it simpler to debug and maintain in the future.

// This function calculates the total price of items in a shopping cart
function calculateTotalPrice($items) {
    $total = 0;
    
    // Loop through each item and add its price to the total
    foreach ($items as $item) {
        $total += $item['price'];
    }
    
    return $total;
}