コード例 #1
0
ファイル: LookupRef.php プロジェクト: kameshwariv/testexample
 /**
  * ROWS
  *
  * Returns the number of rows in an array or reference.
  *
  * Excel Function:
  *        =ROWS(cellAddress)
  *
  * @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            The number of rows in cellAddress
  */
 public static function ROWS($cellAddress = null)
 {
     if (is_null($cellAddress) || $cellAddress === '') {
         return 1;
     } elseif (!is_array($cellAddress)) {
         return Functions::VALUE();
     }
     reset($cellAddress);
     $isMatrix = is_numeric(key($cellAddress));
     list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress);
     if ($isMatrix) {
         return $columns;
     } else {
         return $rows;
     }
 }