class CsvFile extends File

Properties

protected string $path

File path.

from  File
protected resource $handle

File handle.

from  File
protected string $delimiter

Field delimiter.

protected string $enclosure

String enclosure character.

protected string $escape_char

Escape character.

Methods

static CsvFile
makeTmp()

Creates a new temporary file.

from  File
__construct(string $path = null, string $delimiter = ',', string $enclosure = '"', string $escape_char = '\\')

Create a new CSV file.

__destruct()

No description

from  File
delete()

Delete the file.

from  File
close()

Close the file.

from  File
string
getPath()

Returns the path to the file.

from  File
int
put(array $items)

Append a new row to the CSV file.

Details

in File at line 29
static CsvFile makeTmp()

Creates a new temporary file.

Return Value

CsvFile

at line 36
__construct(string $path = null, string $delimiter = ',', string $enclosure = '"', string $escape_char = '\\')

Create a new CSV file.

Parameters

string $path

File path. If not set, a temporary file will be created.

string $delimiter

Optional field delimiter

string $enclosure

Optional string enclosure character

string $escape_char

Oprional escape character

in File at line 50
__destruct()

No description

in File at line 58
delete()

Delete the file.

in File at line 67
close()

Close the file.

in File at line 83
string getPath()

Returns the path to the file.

Return Value

string

at line 49
int put(array $items)

Append a new row to the CSV file.

Parameters

array $items

Row items

Return Value

int