How can PHP developers display the current loop iteration during script execution?

When PHP developers want to display the current loop iteration during script execution, they can use a counter variable that increments with each iteration of the loop. This counter variable can then be echoed or printed to the output to show the current iteration.

// Using a for loop to iterate and display the current loop iteration
for ($i = 1; $i <= 5; $i++) {
    echo "Current iteration: $i <br>";
}