Class \avadim\FastExcelReader\Csv\CsvOptions
On this page
- __construct()
- Parameters
- __get()
- Parameters
- __isset()
- Parameters
- __set()
- Parameters
- create()
- Parameters
- setAllowBinary()
- Parameters
- setCommentPrefix()
- Parameters
- setDelimiter()
- Parameters
- setDoubleQuotes()
- Parameters
- setEnclosure()
- Parameters
- setEncoding()
- Parameters
- setEscape()
- Parameters
- setMode()
- Parameters
- setSkipEmptyLines()
- Parameters
- setStreamFilter()
- Parameters
- setTrimFields()
- Parameters
- toArray()
- Parameters
- __construct() – CsvOptions constructor
- __get() – Magic getter for options
- __isset() – Magic isset for options
- __set() – Magic setter for options
- create() – Create CsvOptions instance
- setAllowBinary() – Allow binary input instead of rejecting it
- setCommentPrefix() – Set comment prefix
- setDelimiter() – Set column delimiter character (null for auto-detect)
- setDoubleQuotes() – Set whether to handle double quotes
- setEnclosure() – Set enclosure character of fields
- setEncoding() – Set input file encoding (null = auto)
- setEscape() – Set escape character, usually '' or '' ('' or null for no escape)
- setMode() – Set parsing mode (strict or tolerant)
- setSkipEmptyLines() – Set whether to skip empty lines
- setStreamFilter() – Set stream filter
- setTrimFields() – Set whether to trim fields (does not affect spaces inside quotes)
- toArray() – Return all options as array
__construct()
public function __construct(array $options = [])
CsvOptions constructor
Parameters
array $options
__get()
public function __get($name): mixed|null
Magic getter for options
Parameters
string $name
__isset()
public function __isset($name): bool
Magic isset for options
Parameters
string $name
__set()
public function __set($name, $value): void
Magic setter for options
Parameters
string $namemixed $value
create()
public static function create(array $options = []): CsvOptions
Create CsvOptions instance
Parameters
array $options
setAllowBinary()
public function setAllowBinary(bool $enable): CsvOptions
Allow binary input instead of rejecting it
By default the reader throws when the file looks binary (a NUL byte, or ahigh share of control characters). Set this to skip that guard, e.g. toforce-parse an unusual text file.
Parameters
bool $enable
setCommentPrefix()
public function setCommentPrefix(?string $value): CsvOptions
Set comment prefix
Parameters
string|null $value
setDelimiter()
public function setDelimiter(?string $delimiter): CsvOptions
Set column delimiter character (null for auto-detect)
Parameters
string|null $delimiter
setDoubleQuotes()
public function setDoubleQuotes(bool $enable): CsvOptions
Set whether to handle double quotes
Parameters
bool $enable
setEnclosure()
public function setEnclosure(string $enclosure): CsvOptions
Set enclosure character of fields
Parameters
string $enclosure
setEncoding()
public function setEncoding(string $encoding): CsvOptions
Set input file encoding (null = auto)
Parameters
string $encoding
setEscape()
public function setEscape(string $escape): CsvOptions
Set escape character, usually '' or '' ('' or null for no escape)
Parameters
string $escape
setMode()
public function setMode(string $mode): CsvOptions
Set parsing mode (strict or tolerant)
Parameters
string $mode
setSkipEmptyLines()
public function setSkipEmptyLines(bool $enable): CsvOptions
Set whether to skip empty lines
Parameters
bool $enable
setStreamFilter()
public function setStreamFilter(?string $filter): CsvOptions
Set stream filter
Parameters
string|null $filter
setTrimFields()
public function setTrimFields(bool $enable): CsvOptions
Set whether to trim fields (does not affect spaces inside quotes)
Parameters
bool $enable
toArray()
public function toArray(): array
Return all options as array
Parameters
None