コード例 #1
0
ファイル: csv.php プロジェクト: hhy5861/php-csv
 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;
     }
 }
コード例 #2
0
ファイル: csv.test.php プロジェクト: Gycianka/DownloadShop
 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);
 }