title: Dynamic text fields values into PHP array
body: <p>I have a dynamic web form that creates text after the user tells it how many he wants, what I want to do, is to get the info of those text fields into the next form, I've read a question that is <BR>
  <a href="https://stackoverflow.com/questions/1784015/javascript-php-dynamic-text-fields-jquery">pretty much what I want to do</a>; <BR>
  But I haven't had any luck so far;<BR></p>
  
  <pre><code>for ($i = 1; $i &lt;= $quantity; $i++) {
  echo "&lt;input type='text' class='text' name='classEmpleado[]' id='empleado$i' /&gt;";}
  </code></pre>
  
  <p>When I try to retrieve them I use this;</p>
  
  <pre><code>$empleado[] = $_POST['classEmpleado[]'];
  $i = 0;    
  for ($i = 1; $i &lt;= $quantity; $i++) {
  echo "$empleado[$i]&lt;BR&gt;&lt;BR&gt;";
  }
  </code></pre>
  
  <p>But I get the error Undefined index: classEmpleado[] 
  What am I doing wrong?</p>
  
  <p>ANSWERED!
  For anyone looking for the same thing, look at the response of Sherbrow,
  And you would just have to edit the loop to this</p>
  
  <pre><code>$empleado[] = $_POST['classEmpleado[]'];
  $i = 0;    
  for ($i = 0; $i &lt; $quantity; $i++) {
  echo "$empleado[$i]&lt;BR&gt;&lt;BR&gt;";
  }
  </code></pre>