◆ close()
Definition at line 76 of file class.ilCSVReader.php.
78 ini_set(self::AUTO_DETECT_LINE_ENDINGS, $this->line_ends);
80 return fclose($this->file_resource);
◆ getCsvAsArray()
ilCSVReader::getCsvAsArray |
( |
| ) |
|
◆ open()
ilCSVReader::open |
( |
string |
$path_to_file | ) |
|
Definition at line 63 of file class.ilCSVReader.php.
References ilUtil\stripSlashes().
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)) {
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
◆ parse()
Definition at line 34 of file class.ilCSVReader.php.
References unquote().
Referenced by getCsvAsArray().
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]);
◆ setDelimiter()
ilCSVReader::setDelimiter |
( |
string |
$a_del | ) |
|
◆ setLength()
ilCSVReader::setLength |
( |
int |
$a_length | ) |
|
◆ setSeparator()
ilCSVReader::setSeparator |
( |
string |
$a_sep | ) |
|
◆ unquote()
ilCSVReader::unquote |
( |
string |
$a_str | ) |
|
|
private |
Definition at line 90 of file class.ilCSVReader.php.
Referenced by parse().
92 return str_replace($this->delimiter . $this->delimiter, $this->delimiter, $a_str);
◆ $data
array ilCSVReader::$data = [] |
|
private |
◆ $delimiter
string ilCSVReader::$delimiter = '""' |
|
private |
◆ $file_resource
ilCSVReader::$file_resource |
|
private |
◆ $length
int ilCSVReader::$length = 1024 |
|
private |
◆ $line_ends
string ilCSVReader::$line_ends |
|
private |
◆ $separator
string ilCSVReader::$separator = ';' |
|
private |
◆ AUTO_DETECT_LINE_ENDINGS
const ilCSVReader::AUTO_DETECT_LINE_ENDINGS = "auto_detect_line_endings" |
The documentation for this class was generated from the following file: