操作系统:Windows 11 PHP版本8.1.6
错误消息: 已弃用:从 float 65.03846153846153 到 int 的隐式转换会丢失 C:xampphtdocssatiimportexcel_reader2.php 第 922 行的精度
public function __construct($file='',$store_extended_info=true,$outputEncoding='') {
$this->_ole = new OLERead();
$this->setUTFEncoder('iconv');
if ($outputEncoding != '') {
$this->setOutputEncoding($outputEncoding);
}
for ($i=1; $i<245; $i++) {
$name = strtolower(( (($i-1)/26>=1)?chr(($i-1)/26+64):'') . chr(($i-1)%26+65)); //line 922
$this->colnames[$name] = $i;
$this->colindexes[$i] = $name;
}
$this->store_extended_info = $store_extended_info;
if ($file!="") {
$this->read($file);
}
}
有人有办法解决这个问题吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
是的,它已被弃用
在传递给
chr()时,您应该将计算结果转换为整数:strtolower( ( ($i-1)/26>=1 ? chr((int) ($i-1)/26+64) : '' ) . chr((int) ($i-1)%26+65) )