What are the best practices for using for-loops in PHP to avoid creating infinite loops or incorrect iterations?

To avoid creating infinite loops or incorrect iterations in PHP for-loops, it is important to ensure that the loop condition is properly defined and that the loop control variable is updated correctly within the loop body. Additionally, it is crucial to handle edge cases and boundary conditions to prevent unexpected behavior.

// Example of a for-loop with proper loop condition and control variable update
for ($i = 0; $i < 10; $i++) {
    // Loop body code here
}