Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function importCsv($file)
- {
- if (($handle = fopen($file, "r")) !== FALSE) {
- $i = 0;
- $infos = [];
- while (($data = fgetcsv($handle, 4000, ";")) !== FALSE) {
- if ($i > 0 ){
- $num = count($data);
- for ($c=0; $c < $num; $c++) {
- $infos[$i-1][$c] = $data[$c];
- }
- }
- $i++;
- }
- $this->setVar( 'infos', $infos);
- fclose($handle);
- return $infos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement