title: How to pass field name and value of dynamic form on submit php
body: <p>I have a form that has fixed fields as well as dynamic fields created from a database.  the fields could be different every time and they are dropdowns with options like color size etc.I could name the dropdowns like this:</p>
  
  <pre><code>name="options[]" 
  </code></pre>
  
  <p>and then do something like:</p>
  
  <pre><code>foreach($options as $option) {
  //add to db
  }
  </code></pre>
  
  <p>however that only gives me the values and I need to know the optionID as well</p>
  
  <p>I could do somethign like:</p>
  
  <pre><code>name="&lt;? echo $optionID; ?&gt;" 
  </code></pre>
  
  <p>for the dropdown but I don't know what optionID's were included in the form when I try to process the submitted data.  how do I pass both the optionID and it's selected value when adding fields to a form dynammically?</p>