本文整理汇总了PHP中PHPExcel_Calculation::_getMatrixDimensions方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Calculation::_getMatrixDimensions方法的具体用法?PHP PHPExcel_Calculation::_getMatrixDimensions怎么用?PHP PHPExcel_Calculation::_getMatrixDimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Calculation
的用法示例。
在下文中一共展示了PHPExcel_Calculation::_getMatrixDimensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ROWS
/**
* ROWS
*
* Returns the number of rows in an array or reference.
*
* @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
* @return integer
*/
public static function ROWS($cellAddress = Null)
{
if (is_null($cellAddress) || $cellAddress === '') {
return 1;
} elseif (!is_array($cellAddress)) {
return PHPExcel_Calculation_Functions::VALUE();
}
$i = array_keys($cellAddress);
$isMatrix = is_numeric(array_shift($i));
list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) {
return $columns;
} else {
return $rows;
}
}
示例2: ROWS
/**
* ROWS
*
* Returns the number of rows in an array or reference.
*
* @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
* @return integer
*/
public static function ROWS($cellAddress = Null)
{
if (is_null($cellAddress) || $cellAddress === '') {
return 0;
} elseif (!is_array($cellAddress)) {
return self::$_errorCodes['value'];
}
$isMatrix = is_numeric(array_shift(array_keys($cellAddress)));
list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) {
return $columns;
} else {
return $rows;
}
}