Beispiel #1
0
 /**
  * @access public
  * @return SingleRow
  */
 public function moveNext()
 {
     $cols = preg_split("/" . $this->_colsep . "/", $this->_rows[$this->_current]);
     $this->_current++;
     $sr = new SingleRow();
     $cntFields = count($this->_fields);
     for ($i = 0; $i < $cntFields; $i++) {
         $sr->addField(strtolower($this->_fields[$i]), $cols[$i]);
     }
     return $sr;
 }
Beispiel #2
0
 /**
  * @access public
  * @return SingleRow
  */
 public function moveNext()
 {
     if ($this->hasNext()) {
         $cols = preg_split($this->_fieldexpression, $this->_currentBuffer, -1, PREG_SPLIT_DELIM_CAPTURE);
         $sr = new SingleRow();
         for ($i = 0; $i < sizeof($this->_fields) && $i < sizeof($cols); $i++) {
             $column = $cols[$i];
             if ($i >= sizeof($this->_fields) - 1 || $i >= sizeof($cols) - 1) {
                 $column = preg_replace("/(\r?\n?)\$/", "", $column);
             }
             $sr->addField(strtolower($this->_fields[$i]), $column);
         }
         $this->readNextLine();
         return $sr;
     } else {
         if ($this->_handle) {
             fclose($this->_handle);
         }
         return null;
     }
 }