title: PHP - merge only keys of an array?
body: <p>Let's say I have a PHP array:</p>
  
  <pre><code>$array1 = array(
     'protein' =&gt; array('PROT', 100, 150),
     'fat'     =&gt; array('FAT',  100, 250),
     'carbs'   =&gt; arary('CARBS', 10, 20)
  );
  
  $array2 = array(
     'vitaminA' =&gt; array('vitA', 1, 2),
     'vitaminB' =&gt; array('vitB', 1, 2),
     'vitaminC' =&gt; arary('vitC', 1, 2)
  );
  </code></pre>
  
  <p>Now I want a combined array of those nutrients (something like <code>array_merge()</code>), but I only need the keys, not the values themselves.</p>
  
  <p>So either this:</p>
  
  <pre><code>$combined = array(
     'protein' =&gt; NULL,
     'fat'     =&gt; NULL,
     'carbs'   =&gt; NULL,
     'vitaminA'=&gt; NULL,
     'vitaminB'=&gt; NULL,
     'vitaminC'=&gt; NULL
  );
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>$combined = array('protein', 'fat', 'carbs', 'vitaminA', 'vitaminB', 'vitaminC');
  </code></pre>
  
  <p>I can do this manually with a <code>foreach</code> loop, but I was hoping there's a function which would make this process fast and optimized.</p>