I am running a loop that ticks a counter.
Basically, it’s
<counter>
<a php form>
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?
<?php
$counter = 0;
//LOOPING CODE IS HERE
example: ---- 'while ( $var->this() ) : $var->that();'----------
// Add to counter
$counter = ++$counter;
// Cleanup after ourselves
endwhile;
?>
now after the endwhile; I need to be able to call the last value of $counter and determine it was = or > 10?
The syntax is