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 Enhancing a Simple PHP Application Paginating a List: Controller Adjusting Invalid Numbers

I think I might be trying to do this in the wrong section of code. Example of code below

$count_less_than_one           = 0;
    $count_between_one_and_thousand = 0;
    $count_greater_than_thousand    = 0;

    foreach ($numbers as $number) {


        $count_less_than_one = count($numbers < 1);


      $count_between_one_and_thousand = count($numbers);


        $count_greater_than_thousand =count($numbers > 1000);
Ken Alger
Ken Alger
Treehouse Teacher

Edited for markdown.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Bethany;

A hint for this challenge would be that we only want to increase the value for the $count_greater_than_thousand variable if the number is greater than 1000. Looks like a good use of a conditional, yes?

Happy coding,

Ken

thanks Ken.