Public Member Functions | |
| csv ($separator= ',', $quote= '"') | |
| protect_field ($field) | |
| export () | |
| __construct ($fieldSeparator= ',', $enclosedBy= '"') | |
| load ($fileName) | |
| getFirstLine () | |
| setCSVContent ($content) | |
| getCSVContent () | |
| createUsableArray ($content, $useFirstLine=true, $keys=null) | |
| format_ok ($format, $delim, $enclosedBy) | |
Data Fields | |
| $separator | |
| $quote | |
| $recordList = array() | |
Protected Member Functions | |
| checkUserIdField ($data) | |
| checkEmailField ($data) | |
Protected Attributes | |
| $fieldSeparator | |
| $enclosedBy | |
| $fileName | |
| $csvContent | |
| $firstLine | |
Definition at line 21 of file csv.class.php.
| __construct | ( | $ | fieldSeparator = ',', |
|
| $ | enclosedBy = '"' | |||
| ) |
constructor
| $fieldSeparator | field separator | |
| $enclosedBy | fields encolsed by |
Definition at line 47 of file csv.class.php.
| checkEmailField | ( | $ | data | ) | [protected] |
check the value of the email field
| $data | email value |
Definition at line 204 of file csv.class.php.
| checkUserIdField | ( | $ | data | ) | [protected] |
check the value of user id field
| $data | user id value |
Definition at line 179 of file csv.class.php.
| createUsableArray | ( | $ | content, | |
| $ | useFirstLine = true, |
|||
| $ | keys = null | |||
| ) |
create an usable array with all the data
| $content | array that need to be changed in an usable array | |
| $useFirstLine | use the first line of the array to define cols | |
| $keys |
Definition at line 130 of file csv.class.php.
| csv | ( | $ | separator = ',', |
|
| $ | quote = '"' | |||
| ) |
constructor.
| $separator | The fields separator. | |
| $quote | The character used to delimit a field. |
Definition at line 34 of file csv.class.php.
| export | ( | ) |
Export the fields
Definition at line 74 of file csv.class.php.
| format_ok | ( | $ | format, | |
| $ | delim, | |||
| $ | enclosedBy | |||
| ) |
check the defined format
| $format | format used in the csv | |
| $delim | field delimiter | |
| $enclosedBy | char used to enclose fields |
Definition at line 236 of file csv.class.php.
| getCSVContent | ( | ) |
get the content of csvContent
Definition at line 115 of file csv.class.php.
| getFirstLine | ( | ) |
Definition at line 91 of file csv.class.php.
| load | ( | $ | fileName | ) |
load the content of a csv file
| $fileName | name of the csv file |
Definition at line 62 of file csv.class.php.
| protect_field | ( | $ | field | ) |
Protect the field using $this->quote if needed.
| $field | The data to protect. |
Definition at line 47 of file csv.class.php.
| setCSVContent | ( | $ | content | ) |
$csvContent [protected] |
Definition at line 35 of file csv.class.php.
$enclosedBy [protected] |
Definition at line 27 of file csv.class.php.
$fieldSeparator [protected] |
Definition at line 23 of file csv.class.php.
$fileName [protected] |
Definition at line 31 of file csv.class.php.
$firstLine [protected] |
Definition at line 37 of file csv.class.php.
| $quote |
Definition at line 24 of file csv.class.php.
| $recordList = array() |
Definition at line 25 of file csv.class.php.
| $separator |
Definition at line 23 of file csv.class.php.
1.6.3