title: PHP - How to merge arrays inside array
body: <p>How to merge n number of array in php. I mean how can I do the job like :<br />
  <code>array_merge(from : $result[0], to : $result[count($result)-1])</code>
  <br /><strong>OR</strong><br />
  <code>array_merge_recursive(from: $result[0], to : $result[count($result) -1])</code></p>
  
  <p><br /></p>
  
  <p>Where <code>$result</code> is an array with multiple arrays inside it like this :</p>
  
  <pre><code>$result = Array(
  0 =&gt; array(),//associative array
  1 =&gt; array(),//associative array
  2 =&gt; array(),//associative array
  3 =&gt; array()//associative array
  )
  </code></pre>
  
  <p>My Result is :</p>
  
  <pre><code>$result = Array(
      0 =&gt; Array(
          "name" =&gt; "Name",
          "events" =&gt; 1,
          "types" =&gt; 2
      ),
      1 =&gt; Array(
          "name" =&gt; "Name",
          "events" =&gt; 1,
          "types" =&gt; 3
      ),
      2 =&gt; Array(
          "name" =&gt; "Name",
          "events" =&gt; 1,
          "types" =&gt; 4
      ),
      3 =&gt; Array(
          "name" =&gt; "Name",
          "events" =&gt; 2,
          "types" =&gt; 2
      ),
      4 =&gt; Array(
          "name" =&gt; "Name",
          "events" =&gt; 3,
          "types" =&gt; 2
      )
  )
  </code></pre>
  
  <p>And what I need is</p>
  
  <pre><code>$result = Array(
  "name" =&gt; "name",
  "events" =&gt; array(1,2,3),
  "types" =&gt; array(2,3,4)
  )
  </code></pre>