jasonrogena / jasonrogena/php-excel-reader

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in [...]\xlsReader\excel_reader2.php on line 347

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?
1. Trying to access a certain xls file (other files are working)
2.
3.

What is the expected output? What do you see instead?
It should just list everything on the first sheet.

Please provide any additional information below.
The code is pretty simple and works with another xls-file, so the problem
somehow lies within the xls itself, but I can't figure out what it might be:
require_once 'pricelist/xlsReader/excel_reader2.php';
$file = $_REQUEST['sheet'];
$xls = new Spreadsheet_Excel_Reader('pricelist/files/'.$file.'');
$numcol = $xls->colcount();
$numrow = $xls->rowcount();

for ($row = 0; $row <= $numrow; $row++) {
for ($col = 0; $col <= $numcol; $col++) {
echo $xls->val($row, $col);
echo ' : ';
}
echo '
';

}
```

Original issue reported on code.google.com by `MIX.Dra...@gmail.com` on 2 Apr 2009 at 10:31

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in excel_reader2.php at line 347 and reproduce the warning with the problematic XLS file using the example script. Trace why the second argument to array_key_exists is not an array or object, then verify that the first sheet can be listed without the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.