42 function __construct($file_name, $open_mode =
'r', $use_include_path =
false, $context = NULL)
44 $this->fp = fopen($file_name, $open_mode, $use_include_path, $context);
49 $this->fname = $file_name;
57 return eof($this->fp);
67 $buf =
fgets($this->fp, $this->max_len);
81 switch(fun_num_args())
111 return array($this->delimiter, $this->enclosure);
118 function flock($operation, &$wouldblock)
120 return flock($this->fp, $operation, $wouldblock);
137 return ftell($this->fp);
146 function fseek($pos, $whence = SEEK_SET)
148 return fseek($this->fp, $pos, $whence);
158 $c =
fgetc($this->fp);
177 return fgetss($this->fp, $allowable_tags);
187 return fscanf($this->fp, $format );
204 return fstat($this->fp);
277 return !$this->
eof();
286 if (is_null($this->line))
327 $this->line =
fgets($this->fp, $this->max_len);
370 while($this->lnum < $line_pos && !$this->
eof())
fflush()
Flush current data.
freeLine()
Free the current line buffer and increment the line counter.
__construct($file_name, $open_mode= 'r', $use_include_path=false, $context=NULL)
Constructs a new file object.
fscanf($format)
Scan the next line.
fwrite($str, $length=NULL)
getCsvControl($delimiter= ',', $enclosure= '"')
rewind()
Invalidate current line buffer and set line number to 0.
setCsvControl($delimiter= ';', $enclosure= '"')
Set the delimiter and enclosure character used in fgetcsv.
flock($operation, &$wouldblock)
fseek($pos, $whence=SEEK_SET)
Interface for recursive iteration with RecursiveIteratorIterator.
fgetcsv($delimiter=NULL, $enclosure=NULL)
fgetss($allowable_tags=NULL)
Get a line from the file and strip HTML tags.
Object representation for any stream.
fgets()
increase current line number
fpassthru()
Read and return remaining part of stream.
Exception thrown for errors that are only detectable at runtime.
next()
Invalidate current line buffer.
const DROP_NEW_LINE
Flag: wheter to suppress new lines.