title: Best practice for submitting nested form data to PHP?
body: <p><strong>The Problem</strong> </p>
  
  <p>I'm trying to figure out the best way to submit data from your typical HTML form to a PHP file. The data looks something like this:</p>
  
  <ol>
  <li>question 1
  <ul>
  <li>answer choice 1</li>
  <li>answer choice 2</li>
  <li>answer choice 3</li>
  </ul></li>
  <li>question 2
  <ul>
  <li>answer choice 1</li>
  <li>answer choice 2</li>
  </ul></li>
  </ol>
  
  <p><strong>My Solution</strong></p>
  
  <p>This is where my question comes in. Would it be appropriate to use a multi-dimensional array? As you can see from my example above, the number of choices could vary for each question. So why not store the number of choices per each question into the second slot of each row of choices (the first slot would be the string for the question text):</p>
  
  <ul>
  <li>[0][0] : String for question 1 </li>
  <li>[0][1] : Number of choices for question 1</li>
  <li>[0][2] : Answer choice for question 1</li>
  <li>[0][3] : Answer choice for question 2</li>
  <li>[0][4] : Answer choice for question 3</li>
  <li>[0][5] : Answer choice for question 4</li>
  <li>[1][0] : String for question 2</li>
  <li>[1][1] : Number of choices for question 2</li>
  <li>[1][2] : Answer choice for question 2</li>
  <li>[1][3] : Answer choice for question 2</li>
  </ul>
  
  <p>I feel this is not a good approach however, because it would be difficult to change later. Is there some way of passing objects into PHP without the need for JavaScript?</p>