Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam Tatusko
16,589 PointsPHP Loops
The last loop in this video runs 21 times, not 19 (as specified).
2 Answers
William Twiner
2,605 PointsTo get it to run one less time we would only need to have the < symbol instead of <=
Harley Urquhart
26,203 Pointsthe reason it runs 21 times is that he is using the <= operator and he is starting from 0 if he started from 1 and used the < operator he would have the loop run 19 time instead of 21
Geoff Parsons
11,679 PointsGeoff Parsons
11,679 PointsOpps. Good catch Adam. I let Hampton Paulk know.