title: PHP Loop through HTML table elements from submit form
body: <p>I have a jQuery function to dynamically add rows containing input fields, this exists on a form, the function adds text boxes (distinct names)  to each cell in the table</p>
  
  <p>an example of the generated HTML would be:</p>
  
  <pre><code>&lt;table width="400" border="0" cellspacing="0" cellpadding="2px" margin="0" &gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" name="name_1"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="surname_1"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="age_1"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" name="name_2"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="surname_2"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="age_2"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" name="name_3"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="surname_3"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="age_3"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am reading the "$_POST['varName'] data with the following code:</p>
  
  <pre><code>&lt;?php
      $cnt = 1 ;
      $fName = ( $name ."_" .$cnt) ;
      do {
          echo("$_POST[$fName]  &lt;br&gt;");
          $cnt = $cnt +1 ; 
          $fName = ( $fldName ."_" .$cnt) ;
  
          } while (isset($_POST[$fName]));
      ?&gt;
  </code></pre>
  
  <p>however, i would like to simply loop through each row in the table and read the data sequentially in a loop (using PHP), my idea is to pass the table object to a php function, is this possible?</p>
  
  <p>Basically i am looking for a solution to read the table data, where each row contains input boxes "name_X", "surname_x" and "age_x" and i will not know how many rows exist at design time... (i will never have more than 9 rows)   </p>
  
  <p>Hope this is clear! 
  ... Any Suggestions?</p>