123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- class Import
- {
-
- function csv_to_array($filename)
- {
- $result = array ();
- $handle = fopen($filename, "r");
- if($handle === false)
- {
- return $result;
- }
- $keys = fgetcsv($handle, 1000, ";");
- while (($row_tmp = fgetcsv($handle, 1000, ";")) !== FALSE)
- {
- $row = array ();
- foreach ($row_tmp as $index => $value)
- {
- $row[$keys[$index]] = $value;
- }
- $result[] = $row;
- }
- fclose($handle);
- return $result;
- }
- }
- ?>
|