Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

read more files

Help
2009-02-05
2013-05-02
  • carlo sbordoni
    carlo sbordoni
    2009-02-05

    Can I read more files xls with the same instance?
    require_once 'Excel/reader.php';

    $dataxls = new Spreadsheet_Excel_Reader();

    $dataxls->setOutputEncoding('CP1251');

    $dataxls->read(file1.xls); // 3 rows
    echo $dataxls->sheets[0]['numRows']; // print 3
    for ($i = 2; $i <= $dataxls->sheets[0]['numRows']; $i++) {
          echo $dataxls->sheets[0]['cells'][$i][5]);
          echo ...
    }
    $dataxls->read(file2.xls); // 5 rows
    echo $dataxls->sheets[0]['numRows']; // print 3
    for ($i = 2; $i <= $dataxls->sheets[0]['numRows']; $i++) {
          echo $dataxls->sheets[0]['cells'][$i][5]);
          echo ...
    }

    the print of numrows are always 3? why this??
    please help me