Back to lesson
1. Why don't you have to increment a for loop inside the loop itself?
Because the incrementing gets done inside the conditional section of the loop.
PHP does the incrementing itself.
For loops increment automatically.
2. Which uses less code, a for loop or a while loop?
A While loop.
A for loop
3. Where do you initialize your counter in a for loop?
Inside the conditional section of the loop.
At the end.
At the beginning.
Back to the top
© 2017 GoSkills Ltd.
Skills for career advancement