Transform.php
public static function csvFileToArray($filename='', $delimiter=',')
    {
        $header = null;
        $data = [];
        if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
                if (!$header) {
                    $header = $row;
                } else {
                    $data[] = array_combine($header, $row);
                }
            }
            fclose($handle);
        }

        return $data;
    }
public static function csvFileToArray($filename='', $delimiter=',')
    {
        $header = null;
        $data = [];
        if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
                if (!$header) {
                    $header = $row;
                } else {
                    $data[] = array_combine($header, $row);
                }
            }
            fclose($handle);
        }

        return $data;
    }
public static function csvFileToArray ( $ filename = '' , $ delimiter = ',' ) { $ header = null ; $ data = [ ] ; if ( ( $ handle = fopen ( $ filename , 'r' ) ) !== false ) { while ( ( $ row = fgetcsv ( $ handle , 1000 , $ delimiter ) ) !== false ) { if ( ! $ header ) { $ header = $ row ; } else { $ data [ ] = array_combine ( $ header , $ row ) ; } } fclose ( $ handle ) ; } return $ data ; }
Transform csv file into array data
@param string $filename
@param string $delimiter
@return array
Transform csv file into array data