title: Create a array inside existing array in Php
body: <p>I have following array and i want to add "image" array inside that array(current array),How can i do this ?</p>
  
  <p>here is my current array</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 2
              [first_name] =&gt; sandeep
              [last_name] =&gt; sharma
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 3
              [first_name] =&gt; Gaurav
              [last_name] =&gt; Jain
         )
  </code></pre>
  
  <p>And i want array something like this(want "image array" inside current array)</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 2
              [first_name] =&gt; sandeep
              [last_name] =&gt; sharma
              [image] =array
                  (
                      [0] =&gt; Array
                          (
                              [image] =&gt; abc.jpg
                          )
                      [1] =&gt; Array
                          (
                              [image] =&gt; abcdef.jpg
                          )   
                  )
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 3
              [first_name] =&gt; Gaurav
              [last_name] =&gt; Jain
              [image] =array
                  (
                      [0] =&gt; Array
                          (
                              [image] =&gt; abcdefghi.jpg
                          )
                  )
         )
  </code></pre>
  
  <p>I tried with following code but its showing image array in last,i want image array inside current array,here is my code</p>
  
  <pre><code>$rows = $query-&gt;result_array(); //current array
              array_push($rows, array("image"=&gt;$image));  //$image is second array(where image save as array)
  </code></pre>