title: Simple PHP Budget
body: <p>I'm trying to make a simple budget form. What I need is that if some item is checked the system adds the price of these item (and if unchecked that item again substract it's price of the total).</p>
  
  <pre><code>&lt;form name="myform" method ='post'&gt;
  &lt;input name="item" type="checkbox" value="flowers"/&gt;
  &lt;input name="item" type="checkbox" value="animals"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And what I want is something like</p>
  
  <pre><code>if (item[1].checked) $total_price = $total_price + item[1];
  </code></pre>
  
  <p>And likewise</p>
  
  <pre><code>if (item[1].unchecked) $total_price = $total_price - item[1];
  </code></pre>