38 while (($line = fgetcsv($this->file_resource, $this->length, $this->separator)) !==
false) {
39 $line_count = count($line);
40 for ($col = 0; $col < $line_count; $col++) {
41 $this->data[$row][$col] = $this->
unquote($line[$col]);
50 $this->separator = $a_sep;
55 $this->delimiter = $a_del;
60 $this->length = $a_length;
63 public function open(
string $path_to_file): bool
65 $this->line_ends = ini_get(self::AUTO_DETECT_LINE_ENDINGS);
66 ini_set(self::AUTO_DETECT_LINE_ENDINGS,
true);
70 if (!is_resource($this->file_resource)) {
78 ini_set(self::AUTO_DETECT_LINE_ENDINGS, $this->line_ends);
80 return fclose($this->file_resource);
90 private function unquote(
string $a_str): string
92 return str_replace($this->delimiter . $this->delimiter, $this->delimiter, $a_str);
setDelimiter(string $a_del)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
const AUTO_DETECT_LINE_ENDINGS
open(string $path_to_file)
setSeparator(string $a_sep)