title: Array for-loop and remove button php
body: <p>I have this code:</p>
  
  <pre><code>&lt;?php
  $animals = array('cat', 'dog', 'mouse', 'elephant');
  for($i=0, $n = count($animals); $i++){
      echo $animals[$i]. '&lt;input type="submit" name="remove" value="remove"/&gt;&lt;br/&gt;';
      if(isset($_POST['remove'])){
          unset($animals[$i]);
      }
  }
  ?&gt;
  </code></pre>
  
  <p>When I click on the remove button nothing happens. Any idea?</p>