|
| $filepath ='' |
|
| $_dir ='' |
|
| $_filename ='' |
|
| $deliminator = ',' |
|
| $field_headers =false |
|
| $values ='' |
|
| $line_count =0 |
|
Definition at line 29 of file csv.inc.
countLines |
( |
|
$start_at = 0 | ) |
|
Count the number of lines in the CSV file
If no filepath then export to screen
- Parameters
-
int | $start_at | the line number to start importing at |
- Returns
- void public
Definition at line 455 of file csv.inc.
Constructor
- Parameters
-
string | $filepath | the path to the file we are parsing/creating |
public
Definition at line 92 of file csv.inc.
export |
( |
|
$ordered = false | ) |
|
Export the current values to the current set filepath
If no filepath then export to screen
- Parameters
-
boolean | $ordered | if true, then use ordered export if possible. if false/default, use standard export ('ordered' == use field headers as keys, as opposed to using numeric indices) |
- Returns
- void public
Definition at line 243 of file csv.inc.
exportValues |
( |
|
$ordered = false | ) |
|
exportValues Takes values and either appends them to the file previously specified or prints out the extra data
This is used after the initial export(). export either sets the header for the browser, or creates the file and then prints the csv header line (if necessary). This either appends more data to the csv file, or prints out more data.
- Parameters
-
boolean | $ordered | Whether the values need to be ordered or not. |
- Returns
- void
Definition at line 316 of file csv.inc.
formatLine |
( |
& |
$array, |
|
|
|
$deliminator = ',' |
|
) |
| |
Format a CSV line
- Parameters
-
array | $array | an array of data values |
string | $deliminator | the deliminator to use between data values |
- Returns
- void public
Definition at line 389 of file csv.inc.
formatOrderedLine |
( |
& |
$array, |
|
|
|
$deliminator = ',' |
|
) |
| |
Format a CSV line
- Parameters
-
array | $array | an array of data values |
string | $deliminator | the deliminator to use between data values |
- Returns
- void public
Definition at line 418 of file csv.inc.
import |
( |
|
$start_at = 1 , |
|
|
|
$lines = 0 |
|
) |
| |
Import the current file to this->values
- Parameters
-
int | $start_at | the line number to start importing at |
int | $lines | the number of lines to import (set to zero for all lines) |
- Returns
- void public
Definition at line 340 of file csv.inc.
Checks to see if the supplied string exists as an entry in the file
- Returns
- boolean public
Definition at line 490 of file csv.inc.
setDeliminator |
( |
|
$deliminator | ) |
|
Set the deliminator for the CSV file
- Parameters
-
string | $deliminator | the deliminator string |
- Returns
- void public
Definition at line 137 of file csv.inc.
setFieldHeaders |
( |
& |
$headers | ) |
|
Set the field headers for the CSV file
- Parameters
-
array | &$headers | an array of the field names |
- Returns
- void public
Definition at line 107 of file csv.inc.
setFilename |
( |
|
$filename = '' | ) |
|
Set the filename for the CSV we are parsing/creating
- Parameters
-
string | $filename | the filename to set |
- Returns
- void public
Definition at line 152 of file csv.inc.
setFilepath |
( |
|
$filepath = '' | ) |
|
Set the file path for this CSV file
- Parameters
-
string | $filepath | the file path to set |
- Returns
- void public
Definition at line 167 of file csv.inc.
setHeader |
( |
|
$header = '' | ) |
|
Set the PHP mime header
This will overwrite any previous headers
- Parameters
-
string | $header | any custom headers that need to be set |
- Returns
- void public
Definition at line 199 of file csv.inc.
Set the values for the CSV file
- Parameters
-
array | $headers | a multi-dimensional array of line values |
- Returns
- void public
Definition at line 122 of file csv.inc.
The documentation for this class was generated from the following file:
- /Users/webmaster/Desktop/squiz_matrix/fudge/csv/csv.inc