Created
September 12, 2018 09:34
-
-
Save Werninator/fd66e9b9e17069da4ab385e07c74d9fa to your computer and use it in GitHub Desktop.
Revisions
-
Patrick Werner created this gist
Sep 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <?php // modified version of https://steindom.com/articles/shortest-php-code-convert-csv-associative-array function str_getcsv_semicolons($input) { return str_getcsv($input, ';'); } $rows = array_map('str_getcsv_semicolons', file($filedir)); $header = array_shift($rows); $data = []; foreach ($rows as $row) $data[] = array_combine($header, $row);