title: php array_push not pushing
body: <p>I have an html form, that has in <code>input type="number"</code>, and using javascript, sets the amount of <code>input</code>s in a div, each one with a unique name: <code>item1</code>, <code>item2</code>...</p>
  
  <p>I am currently trying to set the values of the inputs in one php array, and then loop through to get the contents, however the <code>echo $item</code> doesn't print anything. </p>
  
  <pre><code>$items = array();
  if (isset($_POST['num'])) {
      for ($i = 1; $i &lt;= intval($_POST['num']); $i++) {
          array_push($items, $_POST['item' + $i]);
      }
      foreach ($items as $item) {
          echo $item;
      }
  }
  </code></pre>
  
  <p>If it helps, here is my html form and javascript:</p>
  
  <pre><code>How many Items: &lt;input min="1" max="5" type="number" onchange="updateInput(this.value, document.getElementById('itemSpace'), 1, 5)" name="num"/&gt;
  Enter the items: &lt;div id="itemSpace" name="itemSpace"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Js:</p>
  
  <pre><code>function updateInput(value, elem, min, max) {
      if (value &gt; min - 1 &amp;&amp; value &lt; max + 1) {
          if (value &lt; elem.childElementCount) {
              var oldVal = (value - elem.childElementCount) * -1;
              for (var i = 0; i &lt; oldVal; i++) {
                  elem.removeChild(elem.childNodes[elem.childElementCount - 1]);
              }
          } else {
              var children = elem.childElementCount
              var newVal = value; - elem.childElementCount;
              for (var j = 0; j &lt; newVal; j++) {
                  var newElem = document.createElement("input");
                  newElem.setAttribute("type", "text");
                  newElem.setAttribute("name", "item" + (children - j + 1));                          elem.appendChild(newElem);
              }
          }
      }
  }
  </code></pre>