title: How to merge two objects in PHP
body: <p>I have problem when try to merge two array in PHP. For example I have:</p>
  
  <pre><code>(
      [k] =&gt; Array
          (
              [aaaa] =&gt; 11
              [bbb] =&gt; 22
          )
  
  )
  </code></pre>
  
  <p>And an array two follow:</p>
  
  <pre><code>(
      [k] =&gt; Array
          (
              [ccc] =&gt; 333
              [dddd] =&gt; 444
              [eeee] =&gt; 555
              [ffff] =&gt; 666
          )
  )
  </code></pre>
  
  <p>I want to merge two arrays above as follows:</p>
  
  <pre><code>(
      [k] =&gt; Array
          (
              [aaaa] =&gt; 11
              [bbb] =&gt; 22
              [ccc] =&gt; 333
              [dddd] =&gt; 444
              [eeee] =&gt; 555
              [ffff] =&gt; 666
          )
  )
  </code></pre>
  
  <p>When I try to array_push above as follows: </p>
  
  <pre><code>(
      [0] =&gt; Array
          (
              [k] =&gt; Array
                  (
                      [aaaa] =&gt; 11
                      [bbb] =&gt; 22
                  )
  
          )
  
      [1] =&gt; Array
      (
          [k] =&gt; Array
              (
                  [ccc] =&gt; 333
                  [dddd] =&gt; 444
                  [eeee] =&gt; 555
                  [ffff] =&gt; 666
              )
      )
  )
  </code></pre>
  
  <p>So what can I will do, anyone?</p>