\Csvimport

CodeIgniter CSV Import Class

This library will help import a CSV file into an associative array.

This library treats the first row of a CSV file as a column header row.

Summary

Methods
Properties
Constants
get_array()
detect_line_endings()
initial_line()
delimiter()
filepath()
column_headers()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_set_detect_line_endings()
_get_detect_line_endings()
_set_initial_line()
_get_initial_line()
_set_delimiter()
_get_delimiter()
_set_filepath()
_get_filepath()
_set_column_headers()
_get_column_headers()
_get_handle()
_close_csv()
$handle
$filepath
$column_headers
$initial_line
$delimiter
$detect_line_endings
N/A

Properties

$handle

$handle : 

Type

$filepath

$filepath : 

Type

$column_headers

$column_headers : 

Type

$initial_line

$initial_line : 

Type

$delimiter

$delimiter : 

Type

$detect_line_endings

$detect_line_endings : 

Type

Methods

get_array()

get_array(  $filepath = FALSE,   $column_headers = FALSE,   $detect_line_endings = FALSE,   $initial_line = FALSE,   $delimiter = FALSE) : array

Function that parses a CSV file and returns results as an array.

Parameters

$filepath
$column_headers
$detect_line_endings
$initial_line
$delimiter

Returns

array

detect_line_endings()

detect_line_endings(  $detect_line_endings) : void

Sets the "detect_line_endings" flag

Parameters

$detect_line_endings

initial_line()

initial_line(  $initial_line) : void

Sets the initial line from which start to parse the file

Parameters

$initial_line

delimiter()

delimiter(  $delimiter) : void

Sets the values delimiter

Parameters

$delimiter

filepath()

filepath(  $filepath) : void

Sets the filepath of a given CSV file

Parameters

$filepath

column_headers()

column_headers(  $column_headers) : void

Sets the alternate column headers that will be used when creating the array

Parameters

$column_headers

_set_detect_line_endings()

_set_detect_line_endings(  $detect_line_endings) : void

Sets the "detect_line_endings" flag

Parameters

$detect_line_endings

_get_detect_line_endings()

_get_detect_line_endings() : boolean

Gets the "detect_line_endings" flag

Returns

boolean

_set_initial_line()

_set_initial_line(  $initial_line) : void

Sets the initial line from which start to parse the file

Parameters

$initial_line

_get_initial_line()

_get_initial_line() : integer

Gets the initial line from which start to parse the file

Returns

integer

_set_delimiter()

_set_delimiter(  $delimiter) : void

Sets the values delimiter

Parameters

$delimiter

_get_delimiter()

_get_delimiter() : string

Gets the values delimiter

Returns

string

_set_filepath()

_set_filepath(  $filepath) : void

Sets the filepath of a given CSV file

Parameters

$filepath

_get_filepath()

_get_filepath() : string

Gets the filepath of a given CSV file

Returns

string

_set_column_headers()

_set_column_headers(  $column_headers = '') : void

Sets the alternate column headers that will be used when creating the array

Parameters

$column_headers

_get_column_headers()

_get_column_headers() : mixed

Gets the alternate column headers that will be used when creating the array

Returns

mixed

_get_handle()

_get_handle() : void

Opens the CSV file for parsing

_close_csv()

_close_csv() : array

Closes the CSV file when complete

Returns

array