title: PHP loop through array of HTML textboxes
body: <p>I have an HTML form with a dynamic number of checkbox fields, all of which are encapsulated within a submit form.  When the form is submitted, I want to loop through the values of each checkbox field with a PHP script. At the same time, I have to keep a certain ID associated with the checkbox field so that when I loop through each one in my script, I can use the ID to update the correct row in my database.  Currently, I have:</p>
  
  <pre><code>&lt;input checked="checked" name="attended_&lt;?php echo($pid); ?&gt;"
  </code></pre>
  
  <p>I'm just not sure how to go ahead and access all of the attended[] values from my PHP script (and keep the ID at the same time).  Would I use a multidimensional array like the following?</p>
  
  <pre><code>&lt;input checked="checked" name="attended[&lt;?php echo($i); ?&gt;][&lt;?php echo($pid); ?&gt;]; ?&gt;"
  </code></pre>
  
  <p>I'd appreciate any help on this.  Thanks!</p>