Class csv_inputfile

Description

CSV Inputfile class Manage CSV-formatted files for input.

Open, close and read CSV formatted files for input.

Located in /file-defs.php (line 291)

inputfile
   |
   --csv_inputfile
Method Summary
 boolean csv_inputfile (string $name, [string $dir = ""])
 array readln ([string $delimiter = ","], [integer $maxchars = 4096])
Variables
Methods
Constructor csv_inputfile (line 299)

Constructor Open the given CSV formatted file for input.

  • return: True if file was opened, else false
boolean csv_inputfile (string $name, [string $dir = ""])
  • string $name: The name of the file
  • string $dir: The directory the file is in
readln (line 313)

Reads the next line of the file in the form of an array of fields as delimited by the given charater. Lines can be of a length up to the specified maximum no. of chars.

NB: This properly handles double-quoted elements which contain the delimiter character.

  • return: An array of the CSV fields read in
array readln ([string $delimiter = ","], [integer $maxchars = 4096])
  • string $delimiter: CSV delimiter character, default ","
  • integer $maxchars: Maximum chars per line to read

Redefinition of:
inputfile::readln()
Reads the next line of the file, up to max chars specified.

Inherited Methods

Inherited From inputfile

 inputfile::inputfile()
 inputfile::closefile()
 inputfile::eof()
 inputfile::openfile()
 inputfile::readall()
 inputfile::readln()

Documentation generated by phpDocumentor 1.3.0RC3