Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当单元格中包含带有特殊字符的公式时,PHPExcel getCalculatedValue()返回错误答案_Php_Phpexcel - Fatal编程技术网

当单元格中包含带有特殊字符的公式时,PHPExcel getCalculatedValue()返回错误答案

当单元格中包含带有特殊字符的公式时,PHPExcel getCalculatedValue()返回错误答案,php,phpexcel,Php,Phpexcel,这是我的一段代码,我遇到了麻烦 $where = "O".$i; $formula = '=IFERROR(IF(OR(C'.$i.'="výzva",C'.$i.'="string2"),E'.$i.'," ")," ")'; $objPHPExcel->getActiveSheet()->setCellValue($where, $formula); $objPHPExcel->getActiveSheet()->getCell($where)->getCalc

这是我的一段代码,我遇到了麻烦

$where = "O".$i;
$formula = '=IFERROR(IF(OR(C'.$i.'="výzva",C'.$i.'="string2"),E'.$i.'," ")," ")';
$objPHPExcel->getActiveSheet()->setCellValue($where, $formula);
$objPHPExcel->getActiveSheet()->getCell($where)->getCalculatedValue();
我使用了官方的调试函数
testFormula($sheet,$cell)
,我注意到“výzva”一词在评估过程中出现了问题。我的脚本是用UTF-8编码的,以确保带有特殊字符的单元格正确地写入我最后创建的.xls文件中。当用公式设置CellValue时,在.xls文件中的答案是正确的,但有没有办法从这种类型的公式中获得计算值?谢谢你的建议