limit actions PHP
<p>Basically, I have a function that returns a total amount of "items" inside of a database, The limit on these items is <strong>40</strong>, If the returned value is less than <strong>40</strong> i want it to perform actions thus increasing the the limit by <strong>1</strong> until it reaches <strong>40</strong> again, after that i want it to stop, The code i'm currently using is shown below</p>

<pre><code>$count = $row['COUNT'];
foreach($result as $row) {
    if($count &lt; 40) {
       //I want to execute a function, thus increasing the $count by one evertime
       //until it reaches 40, after that it must stop
    }
}
</code></pre>
