do while loop in php
<p>working on a simple counter program</p>

<p>when button is pressed it adds 1
when other button is pressed it minuses 1</p>

<p>once variable reaches 10, i need it to set the  variable to zero</p>

<p>i'm completely new to php, but i know c++, and in c++ i'd do a do-while loop for this</p>

<p>suggestions?</p>

<pre><code>&lt;?php
session_start(); 
$_SESSION['number'] = ((isset($_SESSION['number'])) ? $_SESSION['number'] : 0); 
if(isset($_GET['add'])){ 
$_SESSION['number']++; 
} 
if(isset($_GET['minus']))
{
    $_SESSION['number']--;
}
?&gt; 
&lt;form action="&lt;? echo $_SERVER['PHP_SELF']; ?&gt;" method="get"&gt; 
&lt;input type="submit" style = "width:100px; height: 100px;"  name="add" value="add" /&gt;        &lt;br&gt;&lt;br&gt;
&lt;input type="submit" style = "width:100px; height: 100px; " name = "minus"     value="minus" /&gt;
&lt;/form&gt; 
&lt;? 
echo $_SESSION['number']; 
?&gt;
</code></pre>
