We're running PHP 5 on a 64bit Linux server and
although we are able to parse spreadsheets with
PHP-ExcelReader, some numbers come out incorrectly.
Before we moved the site to the 64bit machine, it ran
on PHP 4 and everything worked correctly.
Specifically, these numbers:
-20389 -33547 -33523 -44508
import as:
1073721435, 1073708277, 1073708301, 1073697316
using the sample page with PHP-ExcelReader.
The first 4-5 digits of the incorrect numbers are
identical, which will hopefully help someone smarter
than I am figure out what's going on.
Thanks,
Scott
mss@bertucciinc.com
Just replace the code of the GetInt4d and _GetInt4d functions with the following:
$_or_24 = ord($data[$pos+3]);
if ($_or_24>=128)
$_ord_24 = -abs((256-$_or_24) << 24);
else
$_ord_24 = ($_or_24&127) << 24;
return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24;