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 trial

PHP PHP Basics (Retired) PHP Conditionals & Loops For Loops

PHP Loops

The last loop in this video runs 21 times, not 19 (as specified).

Opps. Good catch Adam. I let Hampton Paulk know.

2 Answers

To get it to run one less time we would only need to have the < symbol instead of <=

the 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