title: loop while array key exists php
body: <p>i have an array from a form that has 'blocks' of info like</p>
  
  <pre><code>$array = array(id1 =&gt; 1
                  title1 =&gt; this title
                  id2 =&gt; 2
                  title2 =&gt; this title 2)
  </code></pre>
  
  <p>i am trying to loop through the array like so</p>
  
  <pre><code>$num = 1;
  $posid = "id" . $num;
  while (array_key_exists($posid, $_POST)) {
      echo $posid . "&lt;br&gt;";
      $num++;
  }
  </code></pre>
  
  <p>but i keep getting stuck in an infinite loop.  where am i going wrong?</p>