What are best practices for initializing and updating counting variables in PHP loops for accurate results?

When initializing counting variables in PHP loops, it is important to set them to the correct initial value to ensure accurate results. Additionally, when updating the counting variables within the loop, make sure to use the appropriate increment or decrement operation to reflect the correct progression of the loop.

// Initializing counting variable
$count = 0;

// Loop example
for ($i = 0; $i < 10; $i++) {
    // Update counting variable
    $count++;
}

echo $count; // Output: 10