What is the correct syntax for a for-loop in PHP to ensure it iterates in the desired direction?

When using a for-loop in PHP, the syntax for iterating in the desired direction is crucial. To ensure the loop iterates in the correct direction, you need to specify the initial value, condition, and increment/decrement correctly within the loop declaration. For example, if you want to iterate from 1 to 10 in increments of 1, you should start the loop at 1, set the condition to continue while the value is less than or equal to 10, and increment by 1 each iteration.

// Example of a for-loop iterating from 1 to 10 in increments of 1
for ($i = 1; $i <= 10; $i++) {
    echo $i . " ";
}