CSVDecoder
FinalYes
Methods
- __construct() : mixed
- cells() : array<int, string|null>
- decode() : null|array<string, string|null>|string
- headers() : null|array<int, string>
- Null before the first decoded line: a 0-byte source resolves no header, which is not the same as a header of zero columns.
Methods
__construct()
public
__construct([bool $withHeader = true ][, string $separator = ',' ][, string $enclosure = '"' ][, string $escape = '\\' ][, bool $emptyToNull = true ][, null|array<int, string> $headers = null ][, bool $missingColumnsAsNull = false ]) : mixed
Parameters
- $withHeader : bool = true
- $separator : string = ','
- $enclosure : string = '"'
- $escape : string = '\\'
- $emptyToNull : bool = true
- $headers : null|array<int, string> = null
-
the names of a stream that carries no header record; withHeader must be false
- $missingColumnsAsNull : bool = false
cells()
public
cells(string $line) : array<int, string|null>
Parameters
- $line : string
Return values
array<int, string|null>decode()
public
decode(array<int, string|null> $cells) : null|array<string, string|null>|string
Parameters
- $cells : array<int, string|null>
Return values
null|array<string, string|null>|string —see RecordDecoder::decode()
headers()
Null before the first decoded line: a 0-byte source resolves no header, which is not the same as a header of zero columns.
public
headers() : null|array<int, string>