title: How to extract specific array keys and values to another array?
body: <p>I have an array of arrays like so:</p>
  
  <pre><code>array( array(), array(), array(), array() );
  </code></pre>
  
  <p>the arrays inside the main array contain 4 keys and their values. The keys are the same among all arrays like this:</p>
  
  <pre><code>array( 'id' =&gt; 'post_1',
         'desc' =&gt; 'Description 1',
         'type' =&gt; 'type1',
         'title' =&gt; 'Title'
       );
  
  array( 'id' =&gt; 'post_2',
         'desc' =&gt; 'Description 2',
         'type' =&gt; 'type2',
         'title' =&gt; 'Title'
       );
  </code></pre>
  
  <p>So I want to create another array and extract the <code>id</code> and <code>type</code> values and put them in a new array like this:</p>
  
  <pre><code>array( 'post_1' =&gt; 'type1', 'post_2' =&gt; 'type2'); // and so on
  </code></pre>
  
  <p>The keys in this array will be the value of <code>id</code> key old arrays and their value will be the value of the <code>type</code> key.</p>
  
  <p>So is it possible to achieve this? I tried searching <a href="http://php.net/manual/en/ref.array.php" rel="noreferrer">php.net Array Functions</a> but I don't know which function to use?</p>