ILIAS
Release_5_0_x_branch Revision 61816
|
Helper class to generate CSV files. More...
Public Member Functions | |
__construct () | |
Constructor. | |
setSeparator ($a_sep) | |
Set Seperator. | |
setDelimiter ($a_del) | |
Set delimiter. | |
addRow () | |
Add new line. | |
setDoUTF8Decoding ($doUTF8Decoding) | |
set to true if you want to utf8 decode for output. | |
addColumn ($a_col) | |
Add Column. | |
getCSVString () | |
Get CSV string. |
Private Member Functions | |
quote ($a_str) | |
Quote Delimiter by doubling it This seems to be the standard way in Excel and Openoffice. |
Private Attributes | |
$csv = '' | |
$separator = ',' | |
$delimiter = '"' | |
$new_line = "\n" | |
$doUTF8Decoding = false | |
$first_entry = true |
Helper class to generate CSV files.
Default field seperator is ',' Default string delimiter is '"' Multiple "-'s will be substituted with ""
Definition at line 38 of file class.ilCSVWriter.php.
ilCSVWriter::__construct | ( | ) |
ilCSVWriter::addColumn | ( | $a_col | ) |
Add Column.
Will be quoted automatically
public
string | column value |
Definition at line 113 of file class.ilCSVWriter.php.
References $delimiter, $separator, and quote().
ilCSVWriter::addRow | ( | ) |
ilCSVWriter::getCSVString | ( | ) |
Get CSV string.
public
Definition at line 132 of file class.ilCSVWriter.php.
References $csv.
|
private |
Quote Delimiter by doubling it This seems to be the standard way in Excel and Openoffice.
private
string | field value |
Definition at line 145 of file class.ilCSVWriter.php.
Referenced by addColumn().
ilCSVWriter::setDelimiter | ( | $a_del | ) |
Set delimiter.
public
string | field delimiter |
Definition at line 78 of file class.ilCSVWriter.php.
ilCSVWriter::setDoUTF8Decoding | ( | $doUTF8Decoding | ) |
set to true if you want to utf8 decode for output.
doUTF8Decoding | boolean if set to true file is written using a utf8decode before writing values |
Definition at line 101 of file class.ilCSVWriter.php.
References $doUTF8Decoding.
ilCSVWriter::setSeparator | ( | $a_sep | ) |
Set Seperator.
public
string | field seperator |
Definition at line 66 of file class.ilCSVWriter.php.
|
private |
Definition at line 40 of file class.ilCSVWriter.php.
Referenced by getCSVString().
|
private |
Definition at line 42 of file class.ilCSVWriter.php.
Referenced by addColumn().
|
private |
Definition at line 44 of file class.ilCSVWriter.php.
Referenced by setDoUTF8Decoding().
|
private |
Definition at line 46 of file class.ilCSVWriter.php.
|
private |
Definition at line 43 of file class.ilCSVWriter.php.
Referenced by addRow().
|
private |
Definition at line 41 of file class.ilCSVWriter.php.
Referenced by addColumn().