title: PHP: How to set value into empty index in an Array?
body: <p>I have array in my PHP, for example:</p>
  <h3>array</h3>
  <pre><code>Array
  (
      [0] =&gt; Array 
          (
             [0] =&gt; 
             [1] =&gt; 
             [2] =&gt; 
             [3] =&gt; 
             [4] =&gt; 
             [5] =&gt; Grape
             [6] =&gt; Apple 
             [7] =&gt; Pineaple
             [8] =&gt; Avocado
             [9] =&gt; Banana
          )
  )
  </code></pre>
  <p>and I need to fill the empty element (index <code>0</code> upto <code>4</code>) with new value from an <code>array</code> or <code>$variable</code>.
  Maybe for example, I get the data from another <code>array</code>:</p>
  <h3>newArray</h3>
  <pre><code>Array
  (
      [0] =&gt; Array 
          (
             [0] =&gt; Lemon
             [1] =&gt; Lime
             [2] =&gt; Mango
             [3] =&gt; Watermelon
             [4] =&gt; Starfruit
          )
  )
  </code></pre>
  <p>so I can get a result like this:</p>
  <h3>finalArray</h3>
  <pre><code>Array
  (
      [0] =&gt; Array 
          (
             [0] =&gt; Lemon
             [1] =&gt; Lime
             [2] =&gt; Mango
             [3] =&gt; Watermelon
             [4] =&gt; Starfruit
             [5] =&gt; Grape
             [6] =&gt; Apple 
             [7] =&gt; Pineaple
             [8] =&gt; Avocado
             [9] =&gt; Banana
          )
  )
  </code></pre>
  <p>Any help would be appreciated. Thanks</p>