Exemplo n.º 1
0
 protected function _readLine()
 {
     if (!feof($this->fileHandle)) {
         $this->currentLine = trim(utf8_encode(fgets($this->fileHandle)));
     } else {
         $this->currentLine = null;
     }
     if ($this->currentLine != '') {
         $this->currentArray = Csv::parseString($this->currentLine, $this->separator);
     } else {
         $this->currentArray = null;
     }
 }
Exemplo n.º 2
0
 function testParseString_SomeQuotedStringFromExcel()
 {
     $array = Csv::parseString('One,Two words,"One ""quoted""","Single ""quote"');
     $expected = array('One', 'Two words', 'One "quoted"', 'Single "quote');
     $this->assertEqual($array, $expected);
 }