我有一个导出到 excel 的按钮,可以下载 excel 文件。但是,当我单击它时,它会显示错误为“尝试访问 int 类型值上的数组偏移量”
我的代码是这样的:
public static function dataTypeForValue($pValue = null)
{
// Match the value against a few data types
if ($pValue === null) {
return PHPExcel_Cell_DataType::TYPE_NULL;
} elseif ($pValue === '') {
return PHPExcel_Cell_DataType::TYPE_STRING;
} elseif ($pValue instanceof PHPExcel_RichText) {
return PHPExcel_Cell_DataType::TYPE_INLINE;
} elseif ($pValue[0] === '=' && strlen($pValue) > 1) { //error comes in this line
return PHPExcel_Cell_DataType::TYPE_FORMULA;
} elseif (is_bool($pValue)) {
return PHPExcel_Cell_DataType::TYPE_BOOL;
} elseif (is_float($pValue) || is_int($pValue)) {
return PHPExcel_Cell_DataType::TYPE_NUMERIC;
} …Run Code Online (Sandbox Code Playgroud) 谁能告诉我应该如何将 Bootbox的ok&cancel选项更改为yes& no。
function deletelaw(id) {
bootbox.confirm('Are you sure you want to delete?', function(result) {
if (result) {
$("#deletelaw_" + id).hide();
$(".law1_" + id).prop("checked", false);
var splits = $("#laws_assigned1").val().split(",");
var finalSplit = [];
for (var i = 0; i < splits.length; i++) {
if (id != splits[i]) {
finalSplit.push(splits[i]);
}
}
$("#laws_assigned1").val(finalSplit.join());
}
});
}
Run Code Online (Sandbox Code Playgroud)