52 if(!$this->useHeader || !$this->__file)
55 if($this->cFieldsType ==
'F')
58 $fPos = ftell($this->__file);
59 fseek($this->__file, $this->__hasBOM ? 3 : 0);
61 $h = fgets($this->__file);
63 fseek($this->__file, $fPos);
65 return explode($this->cDelimiter, $h);
70 if(!($line = $this->Fetch()))
73 if(!$this->useHeader || $this->legacy)
76 $header = $this->header;
79 $colCount = count($line);
80 $langFields = array();
81 for($k = 0; $k < $colCount; $k++)
83 $fld = trim(array_shift($header));
90 $subFields = explode(
'.', $fld);
92 foreach($subFields as $subfld)
94 $subfld = trim($subfld);
96 $prev[$subfld] = array();
97 $prev =& $prev[$subfld];
100 $prev = trim($line[$k]);
103 if(mb_strpos($fld,
'NAME') !==
false)
104 $langFields[] = &$prev;
106 $result = array_merge_recursive($result, $resLine);
109 if (is_callable($this->callbacks[
'AFTER_ASSOC_LINE_READ'] ??
''))
111 call_user_func_array(
112 $this->callbacks[
'AFTER_ASSOC_LINE_READ'],
118 if($this->convertCharset && self::FILE_ENCODING != SITE_CHARSET)
120 foreach($langFields as &$value)
122 $value = \CharsetConverter::ConvertCharset($value, self::FILE_ENCODING, SITE_CHARSET);