Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 523 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Csv  - X-Ref

__construct()   X-Ref
Create a new CSV Reader instance.


setConstructorCallback(?callable $callback)   X-Ref
Set a callback to change the defaults.

The callback must accept the Csv Reader object as the first parameter,
and it should return void.

getConstructorCallback()   X-Ref
No description

setInputEncoding(string $encoding)   X-Ref
No description

getInputEncoding()   X-Ref
No description

setFallbackEncoding(string $fallbackEncoding)   X-Ref
No description

getFallbackEncoding()   X-Ref
No description

skipBOM()   X-Ref
Move filepointer past any BOM marker.


checkSeparator()   X-Ref
Identify any separator that is explicitly set in the file.


inferSeparator()   X-Ref
Infer the separator if it isn't explicitly set in the file or specified by the user.


listWorksheetInfo(string $filename)   X-Ref
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).


load(string $filename, int $flags = 0)   X-Ref
Loads Spreadsheet from file.

return: Spreadsheet

openFileOrMemory(string $filename)   X-Ref
No description

setAutoDetect(?string $value)   X-Ref
No description

loadIntoExisting(string $filename, Spreadsheet $spreadsheet)   X-Ref
Loads PhpSpreadsheet from file into PhpSpreadsheet instance.


convertBoolean(&$rowDatum, bool $preserveBooleanString)   X-Ref
Convert string true/false to boolean, and null to null-string.

param: mixed $rowDatum

getDelimiter()   X-Ref
No description

setDelimiter(?string $delimiter)   X-Ref
No description

getEnclosure()   X-Ref
No description

setEnclosure(string $enclosure)   X-Ref
No description

getSheetIndex()   X-Ref
No description

setSheetIndex(int $indexValue)   X-Ref
No description

setContiguous(bool $contiguous)   X-Ref
No description

getContiguous()   X-Ref
No description

setEscapeCharacter(string $escapeCharacter)   X-Ref
No description

getEscapeCharacter()   X-Ref
No description

canRead(string $filename)   X-Ref
Can the current IReader read the file?


guessEncodingTestNoBom(string &$encoding, string &$contents, string $compare, string $setEncoding)   X-Ref
No description

guessEncodingNoBom(string $filename)   X-Ref
No description

guessEncodingTestBom(string &$encoding, string $first4, string $compare, string $setEncoding)   X-Ref
No description

guessEncodingBom(string $filename)   X-Ref
No description

guessEncoding(string $filename, string $dflt = self::DEFAULT_FALLBACK_ENCODING)   X-Ref
No description