Recommend this page to a friend!

      phpCSV  >  All threads  >  Advice  >  (Un) Subscribe thread alerts  
Summary:Some thoughts about usability
Date:2006-03-29 21:02:49

  1. Advice   Reply   Report abuse  
Bolt - 2006-03-29 21:02:49
I suppose that it's better to use fgets() + explode() then fgetcsv(). It provides the ability to use multi-character delimiters. So I rewrited function readCSV():

function readCSV() {
while(($line = fgets($this->getAttribute('handle'), $this->getAttribute('length'))) !== false) {

And one more note - I think it's better to use separate var for results just not to mix with attributes. So i added var $result=array(); in to the beggining of the class and modified function addResult():

function addResult(&$array) {
$this->result[] = $array;

Might be useful for somebody )


For more information send a message to info at phpclasses dot org.