title: How to parse a "problematic" CSV in PHP
body: <p>I've to parse a "problematic" CSV file like this:</p>
  
  <pre><code>some text here
  other line of text, here
  header1, header2, header3
  value1, value2, value3  // data row #1
  value1, value2, value3  // data row #2
  (empty line)
  (empty line)
  some other text here
  </code></pre>
  
  <p>Of course i'm only interested in rows (value1, value2 and value3) that actually contains valuable data. I've tried to fetch the url into a string and than call <code>str_getcsv</code> (default parameters) but what i'm getting is an array that is difficult to work with:</p>
  
  <pre><code>array
    0 =&gt; string 'some text here ' (length=50)
    1 =&gt; string ' other text here
  other text here
  header1 ' (length=50)
    2 =&gt; string 'header2' (length=13)
    3 =&gt; string 'header3' (length=14)
    4 =&gt; string 'header4' (length=14)
    5 =&gt; string '
  value1' (length=2)
    6 =&gt; string 'value2' (length=1)
    7 =&gt; string 'value3' (length=1)
    8 =&gt; string 'value4
  </code></pre>