getCsv() public static method

Empty lines will be skipped. If the 'length' parameter is provided, all rows are filled up with empty strings up to this length, or stripped down to this length.
public static getCsv ( resource $file, array $params = [] ) : array | boolean
$file resource A file pointer.
$params array Optional parameters. Possible values: - escape: The escape character. - length: The expected number of fields. - quote: The quote character. - separator: The field delimiter.
return array | boolean A row from the CSV file or false on error or end of file.
示例#1
0
 protected function readCsv($file, $conf = array())
 {
     $fp = fopen(__DIR__ . '/fixtures/getcsv/' . $file, 'r');
     $data = array();
     while ($res = Horde_Data_Csv::getCsv($fp, $conf)) {
         $data[] = $res;
     }
     return $data;
 }