title: How to combine multiple arrays into one in PHP
body: <p>I have a multiple arrays which I'd like to put into a single array in order to sort it:</p>
  
  <pre><code>$weight = array($weight);
  $dev = array_combine($missing, $weight);
  
  echo "&lt;pre&gt;"; 
  print_r($dev); 
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Array (
    [angular] =&gt; 2
  ) 
  Array (
    [android sdk] =&gt; 3
  ) Array (
    [application] =&gt; 1
  )
  </code></pre>
  
  <p>Now how do I turn the array above into this?</p>
  
  <pre><code>Array (
      [android sdk] =&gt; 3
      [angular] =&gt; 2
      [application] =&gt; 1 )
  </code></pre>
  
  <p>I've tried the below from a solution that I've found on this site, but it returns NULL:</p>
  
  <pre><code>$weight = array($weight);
  $dev = array_combine($missing, $weight);
  $result = call_user_func_array("array_merge", $dev);
  
  echo "&lt;pre&gt;"; 
  print_r($result); 
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <blockquote>
    <p>EDIT</p>
  </blockquote>
  
  <p>Here is my $missing array, some arrays are empty because a match hasn't been found against some keywords:</p>
  
  <pre><code>Array
  (
  )
  Array
  (
      [0] =&gt; angular
  )
  Array
  (
      [0] =&gt; android sdk
  )
  Array
  (
      [0] =&gt; application
  )
  Array
  (
  )
  </code></pre>
  
  <p>Here are the value from $weight:</p>
  
  <blockquote>
    <p>3 2 3 1 3</p>
  </blockquote>
  
  <p>How can I get this?</p>
  
  <pre><code>Array (
      [android sdk] =&gt; 3
      [angular] =&gt; 2
      [application] =&gt; 1 )
  </code></pre>