How can commenting code effectively improve code readability and maintainability in PHP?

Commenting code effectively in PHP can improve code readability and maintainability by providing insights into the purpose and functionality of different parts of the code. This helps other developers (or even yourself in the future) understand the code more easily, making it easier to maintain and update. Comments should be concise, clear, and placed strategically throughout the codebase.

// This function calculates the sum of two numbers
function calculateSum($num1, $num2) {
    // Add the two numbers together
    $sum = $num1 + $num2;
    
    // Return the sum
    return $sum;
}