You are here

public static function PHPExcel_Calculation_Functions::flattenArrayIndexed in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php \PHPExcel_Calculation_Functions::flattenArrayIndexed()

* Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing * *

Parameters

array $array Array to be flattened: * @return array Flattened array

15 calls to PHPExcel_Calculation_Functions::flattenArrayIndexed()
PHPExcel_Calculation_Functions::TYPE in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php
* TYPE * * Returns a number that identifies the type of a value * *
PHPExcel_Calculation_Statistical::AVEDEV in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* AVEDEV * * Returns the average of the absolute deviations of data points from their mean. * AVEDEV is a measure of the variability in a data set. * * Excel Function: * AVEDEV(value1[,value2[, ...]]) * * @access public * @category…
PHPExcel_Calculation_Statistical::AVERAGE in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* AVERAGE * * Returns the average (arithmetic mean) of the arguments * * Excel Function: * AVERAGE(value1[,value2[, ...]]) * * @access public * @category Statistical Functions *
PHPExcel_Calculation_Statistical::AVERAGEA in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* AVERAGEA * * Returns the average of its arguments, including numbers, text, and logical values * * Excel Function: * AVERAGEA(value1[,value2[, ...]]) * * @access public * @category Statistical Functions *
PHPExcel_Calculation_Statistical::COUNT in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* COUNT * * Counts the number of cells that contain numbers within the list of arguments * * Excel Function: * COUNT(value1[,value2[, ...]]) * * @access public * @category Statistical Functions *

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php, line 630

Class

PHPExcel_Calculation_Functions
PHPExcel_Calculation_Functions

Code

public static function flattenArrayIndexed($array) {
  if (!is_array($array)) {
    return (array) $array;
  }
  $arrayValues = array();
  foreach ($array as $k1 => $value) {
    if (is_array($value)) {
      foreach ($value as $k2 => $val) {
        if (is_array($val)) {
          foreach ($val as $k3 => $v) {
            $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v;
          }
        }
        else {
          $arrayValues[$k1 . '.' . $k2] = $val;
        }
      }
    }
    else {
      $arrayValues[$k1] = $value;
    }
  }
  return $arrayValues;
}