PHP grouping based on a value I'm asking in arbitrary sense to avoid going into any unwanted specifics.

Suppose we're to put balls in baskets.
If the there are &lt;6 balls, they don't get to go in any basket.
If there are between 6-12 balls they take up 1 basket.
But if the balls are >12, they take up 2 baskets.

Following is WORKING FINE:

if (count($balls)&lt;=5) {
    $baskets = 0;
} else if (count($balls) &gt; 5 &amp;&amp; count($balls) &lt;12) {
    $baskets = 1;
} else {
    $answer = ceil(count($balls)/12);
}


Question: Is there a better, smarter, and/or quicker way to approach the problem, may be through loops or something?
The middle else if statement is redundent and can be removed. The reason that is redundent is that the only two cases are either equal or less than 5 balls gives 0 baskets and for everything else the number of baskets can be evaluated to be ceil(count($balls)/12). 

Also using short hand will make it more readable I find. 

$baskets = count($balls) &lt;=5 ? 0 : ceil(count($balls)/12);