Property | Type | Description | |
---|---|---|---|
$auto_depth | # number of rows to analyze when attempting to auto-detect delimiter | ||
$auto_non_chars | # characters to ignore when attempting to auto-detect delimiter | ||
$auto_preferred | # returns multiple possible delimiters (happens very rarely) | ||
$conditions | # basic SQL-like conditions for row matching | ||
$convert_encoding | # character encoding options | ||
$data | # two dimentional array of CSV data | ||
$delimiter | # delimiter (comma) and enclosure (double quote) | ||
$enclosure | |||
$fields | # override field names | ||
$file | # current file | ||
$file_data | # loaded file contents | ||
$heading | # use first line/entry as field names | ||
$input_encoding | |||
$limit | # limits the number of returned rows to specified amount | ||
$linefeed | # used by unparse(), save(), and output() functions | ||
$offset | # number of rows to ignore from beginning of data | ||
$output_delimiter | # only used by output() function | ||
$output_encoding | |||
$output_filename | |||
$sort_by | # sort entries by this field | ||
$sort_reverse | |||
$titles | # array of field values in data parsed |
Method | Description | |
---|---|---|
__construct ( $input = null, $offset = null, $limit = null, $conditions = null ) : nothing | Constructor | |
_check_count ( $char, $array, $depth, $preferred ) : special | Check if passed info might be delimiter - only used by find_delimiter() | |
_check_data ( $file = null ) : true | Check file data | |
_enclose_value ( $value = null ) : Processed | Enclose values if needed - only used by unparse() | |
_rfile ( $file = null ) : Data | Read local file | |
_validate_offset ( $current_row ) : true | Validates if the row is within the offset or not if sorting is disabled | |
_validate_row_condition ( $row, $condition ) : true | Validate a row against a single condition | |
_validate_row_conditions ( $row = [], $conditions = null ) : true | Validate a row against specified conditions | |
_wfile ( $file, $string = '', $mode = 'wb', $lock = 2 ) : true | Write to local file | |
auto ( $file = null, $parse = true, $search_depth = null, $preferred = null, $enclosure = null ) : delimiter | Auto-Detect Delimiter: Find delimiter by analyzing a specific number of rows to determine most probable delimiter character | |
encoding ( $input = null, $output = null ) : nothing | Convert character encoding | |
load_data ( $input = null ) : true | Load local file or string | |
output ( $output = true, $filename = null, $data = [], $fields = [], $delimiter = null ) : CSV | Generate CSV based string for output | |
parse ( $input = null, $offset = null, $limit = null, $conditions = null ) : nothing | Parse CSV file or string | |
parse_file ( $file = null ) : 2D | Read file to string and call parse_string() | |
parse_string ( $data = null ) : 2D | Parse CSV strings to arrays | |
save ( $file = null, $data = [], $append = false, $fields = [] ) : true | Save changes, or new file and/or data | |
unparse ( $data = [], $fields = [], $append = false, $is_php = false, $delimiter = null ) : CSV | Create CSV data from array |
public __construct ( $input = null, $offset = null, $limit = null, $conditions = null ) : nothing | ||
return | nothing |
public _check_count ( $char, $array, $depth, $preferred ) : special | ||
return | special | string used for delimiter selection, or false |
public _check_data ( $file = null ) : true | ||
return | true | or false |
public _enclose_value ( $value = null ) : Processed | ||
return | Processed | value |
public _rfile ( $file = null ) : Data | ||
return | Data | from file, or false on failure |
public _validate_offset ( $current_row ) : true | ||
return | true | of false |
public _validate_row_condition ( $row, $condition ) : true | ||
return | true | of false |
public _validate_row_conditions ( $row = [], $conditions = null ) : true | ||
return | true | of false |
public _wfile ( $file, $string = '', $mode = 'wb', $lock = 2 ) : true | ||
return | true | or false |
public auto ( $file = null, $parse = true, $search_depth = null, $preferred = null, $enclosure = null ) : delimiter | ||
return | delimiter | character |
public encoding ( $input = null, $output = null ) : nothing | ||
return | nothing |
public load_data ( $input = null ) : true | ||
return | true | or false |
public output ( $output = true, $filename = null, $data = [], $fields = [], $delimiter = null ) : CSV | ||
return | CSV | data using delimiter of choice, or default |
public parse ( $input = null, $offset = null, $limit = null, $conditions = null ) : nothing | ||
return | nothing |
public parse_file ( $file = null ) : 2D | ||
return | 2D |
public parse_string ( $data = null ) : 2D | ||
return | 2D |
public save ( $file = null, $data = [], $append = false, $fields = [] ) : true | ||
return | true | or false |
public unparse ( $data = [], $fields = [], $append = false, $is_php = false, $delimiter = null ) : CSV | ||
return | CSV | data (text string) |
public $auto_depth |
public $auto_non_chars |
public $auto_preferred |