phpexcel[PHP8.1]Implicitconversionfromfloattointlosesprecision
(2022-10-10 21:13:20)分类: PHP-GO |
在使用在phpexcel插件的时候,碰到好几个问题,记录一下,希望对别人有帮助。
一是使用数组下标索引的时候需要把{0}更改为[0]
二是出现了如下错误
phpexcel [PHP 8.1] Implicit conversion from float to int loses
precision
排查之后发现是
Style/Color.php文件中有一个函数dechex的使用
需要强制转换为整型
$red=intval($red);
$green=intval($green);
$blue=intval($blue);
$rgb = strtoupper(
str_pad(dechex($red), 2,
'0', 0)
.
str_pad(dechex($green), 2,
'0', 0)
.
str_pad(dechex($blue), 2,
'0', 0)
);
前一篇:PHPExcel读取文件内容