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 Arrays and Control Structures PHP Loops While Quizzing

why is this wrong <

i do not know what they want in the blank

2 Answers

The reason you are getting the answer wrong is because they want 10 to be echoed out as well as the other numbers. By using the less than operator the largest number that will be printed is 9 because 10 is not less than 10. By using this less than or equal to operator (<=), 10 will also be printed to the screen and the task will pass because 10 is less than or equal to 10

$i = 1;
while($i <= 10) {
echo $i;
$i++;
}

thank you connor