title: Converting CSV to PHP Array - issue with end line (CR LF)
body: <p>I am converting csv file to an array using code bellow. But, problem is that end of the row is <strong>CR LF</strong>, and it is not detected, so array has wrong offset. CR LF is ignored and "cells" around it are merged.</p>
  
  <p>How could i rewrite code to detect this row ending and split array correctly ? Or, is there better approach to convert csv to array?</p>
  
  <p>There are some simmilar questions here but i have not found solution to this issue yet.</p>
  
  <p>Thanks.</p>
  
  <pre><code>$fileName ='test.csv';   
  $csvData = file_get_contents($fileName); 
  $csvNumColumns = 11; 
  $csvDelim = ";"; 
  $data = array_chunk(str_getcsv($csvData, $csvDelim), $csvNumColumns); 
  
  print_r($data);
  </code></pre>