title: Merging two array elements into one array element in PHP
body: <p>I want to merge two arrays into one array as follows,</p>
  
  <p><strong>Array1:</strong></p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 3
              [sku] =&gt; KOG456
              [cart_id] =&gt; 2
              [name] =&gt; Young Money
              [slug] =&gt; young-money
              [route_id] =&gt; 47
              [description] =&gt; 
  This is test song
  
  
              [excerpt] =&gt; 
              [saleprice] =&gt; 90.00
              [related_products] =&gt; 
              [images] =&gt; {"1c6b0883fc94c5f644497ec488cdf8cb":{"filename":"1c6b0883fc94c5f644497ec488cdf8cb.jpg","alt":"Test","caption":"","primary":true}}
              [seo_title] =&gt; 
              [meta] =&gt; 
              [enabled] =&gt; 1
          )
  
  )
  </code></pre>
  
  <p><strong>Array2:</strong> </p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [filename] =&gt; Beethovens_Symphony_No._9_(Scherzo).wma
              [title] =&gt; Young Money
              [size] =&gt; 599.26
          )
  
  )
  </code></pre>
  
  <p>Expected array result is:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 3
              [sku] =&gt; KOG456
              [cart_id] =&gt; 2
              [name] =&gt; Young Money
              [slug] =&gt; young-money
              [route_id] =&gt; 47
              [description] =&gt; 
  This is test song
  
  
              [excerpt] =&gt; 
              [saleprice] =&gt; 90.00
              [related_products] =&gt; 
              [images] =&gt; {"1c6b0883fc94c5f644497ec488cdf8cb":{"filename":"1c6b0883fc94c5f644497ec488cdf8cb.jpg","alt":"Test","caption":"","primary":true}}
              [seo_title] =&gt; 
              [meta] =&gt; 
              [enabled] =&gt; 1
              [filename] =&gt; Beethovens_Symphony_No._9_(Scherzo).wma
              [title] =&gt; Young Money
              [size] =&gt; 599.26
          )
  
  )
  </code></pre>
  
  <p>How to merge these array elements into one array element ?</p>