get last $var in a 'while' statement, php?
<p>I am running a loop that ticks a counter.</p>

<p>Basically, it's </p>

<pre><code>&lt;counter&gt;
&lt;a php form&gt;
</code></pre>

<p>the counter is pulling objects from a database. If there are 10 or more objects pulled, I want the form to be shut off. I'm not sure how to pull the counter out of the 'while' statement though?</p>

<pre><code>&lt;?php
    $counter = 0;

    //LOOPING CODE IS HERE
    example: ---- 'while ( $var-&gt;this() ) : $var-&gt;that();'----------

    // Add to counter
    $counter = ++$counter;

    // Cleanup after ourselves
    endwhile;
?&gt;
</code></pre>

<p>now after the <code>endwhile;</code> I need to be able to call the last value of <code>$counter</code> and determine it was = or > 10?</p>
