title: Extract column from csv data in PHP
body: <p>I have <code>csv</code> data in <code>PHP</code> such as the following (note, it's text with new line characters in it, not a file):</p>
  
  <pre><code>$data = 'A,B,C,D,E,F,G,H
      1,1,2014-12-10,5,1,2,0,2
      2,7,2014-12-09,9,0,,7,2';
  </code></pre>
  
  <p>How can I extract a column as an array that excludes the headers? For example, if I wanted to extract the 4th column, it would include 5 and 9.</p>
  
  <p><strong>UPDATE</strong>: I have tried</p>
  
  <pre><code>$te = array_column($data,'D');
  </code></pre>
  
  <p>and I get the error: <code>Warning: array_column() expects parameter 1 to be array,</code> </p>