for an associative array, return all the values for given column name
see also uniqueCol

@param array  $rows    the array
@param string $colName the name of the "column" to get

@return array
342511
public static function columnVals($rows, $colName)
    {
        $return = array();
        foreach ($rows as $row) {
            $return[] = isset($row[$colName])
                ? $row[$colName]
                : null;
        }
        return $return;
    }
317888
public static function rowsToArray($rows, array $options = [])
    {
        $limit = array_get($options, 'limit', 0);
        $offset = array_get($options, 'offset', 0);

        $array = [];
        if ($offset > 0) {
            if ($limit > 0) {
                for ($i = 0; ($i < $limit && $rows->offsetExists($offset + $i)); $i++) {
                    $array[] = $rows->offsetGet($offset + $i);
                }
            } else {
                for ($i = 0; $rows->offsetExists($offset + $i); $i++) {
                    $array[] = $rows->offsetGet($offset + $i);
                }
            }
        } else {
            foreach ($rows as $row) {
                $array[] = $row;
            }
        }

        return $array;
    }
28084
protected function valueLists( $rows, $columns ) {

        $lists = array();

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $values[] = $this->quote( @$row[ $column ] );

            }

            $lists[] = "( " . implode( ", ", $values ) . " )";

        }

        return $lists;

    }
506737
public static function uniqueCol($array, $colsToGet, $assoc = true)
    {
        if (!\is_array($array)) {
            $array = array();
        }
        if (!\is_array($colsToGet)) {
            $colsToGet = array($colsToGet);
        }
        $colValuesTemp    = array();
        $colValuesStrings = array();
        $colValues = array();
        foreach (\array_keys($array) as $i) {
            $lineValues = array();
            foreach ($colsToGet as $colname) {
                if (isset($array[$i][$colname])) {
                    $lineValues[$colname] = $array[$i][$colname];
                }
            }
            if (!empty($lineValues)) {
                $lineString = \implode('', \array_values($lineValues));
                \array_push($colValuesTemp, $lineValues);
                \array_push($colValuesStrings, $lineString);
            }
        }
        $keys = \array_keys(\array_unique($colValuesStrings));      // $keys are the line-#s
        foreach ($keys as $key) {
            \array_push($colValues, $colValuesTemp[$key]);
        }
        if (\count($colsToGet) == 1) {
            \sort($colValues);
            if (!$assoc) {
                foreach ($colValues as $i => $a) {
                    $colValues[$i] = $a[ $colsToGet[0] ];
                }
            }
        } else {
            $colValues = self::fieldSort($colValues, $colsToGet);
        }
        return $colValues;
    }
330981
public function getFieldForColumn($columnName)
    {
        if (isset($this->fieldNames[$columnName])) {
            return $this->fieldNames[$columnName];
        } else {
            foreach ($this->associationMappings as $assocName => $mapping) {
                if ($this->isAssociationWithSingleJoinColumn($assocName) &&
                    $this->associationMappings[$assocName]['joinColumns'][0]['name'] == $columnName) {

                    return $assocName;
                }
            }

            throw MappingException::noFieldNameFoundForColumn($this->name, $columnName);
        }
    }
512817
protected function rowspanGetRowNames($rowName, $rowspan) {
    $rowIndex = $this->rows[$rowName];
    $rowNames = array();
    for ($i = 0; $i < $rowspan; ++$i) {
      $rowNames[$i + $rowIndex] = $this->rowNames[$i + $rowIndex];
    }
    return $rowNames;
  }
1190725
protected function fetchColumnValue($data, $columns)
    {
        if (is_string($columns)) {
            return Arr::get($data, $columns);
        }

        if (is_array($columns)) {
            $value = [];
            foreach ($columns as $name => $column) {
                if (!Arr::has($data, $column)) {
                    continue;
                }
                $value[$name] = Arr::get($data, $column);
            }

            return $value;
        }
    }
777014
public function populate($rows)
    {
        $indexBy = $this->indexBy;

        if ($indexBy === null) {
            return $this->createObjects($rows);
        }
        $result = [];
        foreach ($rows as $row) {
            if (is_string($indexBy)) {
                $key = $row[$indexBy];
            } else {
                $key = call_user_func($indexBy, $row);
            }
            $result[$key] = $this->createObject($row);
        }
        return $result;
    }
1159108
public function pluck($columnName/*...$columnNames*/)
    {
        if (is_array($columnName)) {
            $columnNames = $columnName;
        } else {
            $columnNames = func_get_args();
        }
        
        $select = clone $this->select;
        $select->columns($columnNames);
        $records = $this->loadRecords($select);
        
        if (count($columnNames) == 1) {
            return array_map(function($x) {
                return current($x);
            }, $records);
        } else {
            return $records;
        }
    }
637738
private function createBottomHeadingRow(array $rows)
    {
        $elements = array();

        if ($this->options[self::GRID_PARAM_BATCH] === true) {
            $elements[] = $this->createColumn(null, null);
        }

        foreach ($rows as $row) {
            // Ignore if configuration for current column isn't provided
            if (!$this->hasColumnConfiguration($row[self::GRID_PARAM_COLUMN])) {
                continue;
            }

            // Find out whether a column needs to have a filter
            $filter = $this->findOptionByColumn($row[self::GRID_PARAM_COLUMN], self::GRID_PARAM_FILTER);

            // Use provided name if available, otherwise name it as a column
            $inputName = isset($row[self::GRID_PARAM_NAME]) ? $row[self::GRID_PARAM_NAME] : $row[self::GRID_PARAM_COLUMN];

            // Full-qualified input name
            $name = $this->createInputName(self::GRID_PARAM_FILTER, $inputName);

            if ($filter) {
                // If filter is array, then assume its for select
                $selected = $this->filter->get($inputName);

                if (is_array($filter)) {
                    $filter = array_replace(array('' => ''), $filter);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    // If explicit boolean filter provided
                } else if ($filter === 'boolean') {
                    $options = array(
                        '0' => 'No',
                        '1' => 'Yes'
                    );

                    // Translate boolean values on demand
                    if ($this->hasTranslator()) {
                        $options = $this->translator->translateArray($options);
                    }

                    $filter = array_replace(array('' => ''), $options);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    
                } else {
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected);
                }

            } else {
                $elements[] = $this->createColumn(null, '');
            }
        }

        if ($this->hasActions()) {
            $elements[] = $this->createTextHeader('');
        }

        return $this->createTableRow($elements);
    }
276082
public function get($col, $row)
    {
        $this->checkCoords($col, $row);

        return $this->grid{$this->toIndex($col, $row)};
    }
351259
function Fields($colname)
	{
		if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
		if (!$this->bind) {
			$this->bind = array();
			for ($i=0; $i < $this->_numOfFields; $i++) {
				$o = $this->FetchField($i);
				$this->bind[strtoupper($o->name)] = $i;
			}
		}

		 return $this->fields[$this->bind[strtoupper($colname)]];
	}
316613
public function populate($rows): array
    {
        $result = [];

        if ($this->indexBy === null) {
            return array_values($rows); // reset storage internal keys
        }

        foreach ($rows as $row) {
            if (is_string($this->indexBy)) {
                $key = $row[$this->indexBy];
            } else {
                $key = call_user_func($this->indexBy, $row);
            }
            $result[$key] = $row;
        }

        return $result;
    }
814145
public static function getTableColumns(string $schemaName, string $tableName): array
  {
    $sql = sprintf('
select COLUMN_NAME        as column_name
,      COLUMN_TYPE        as column_type
,      IS_NULLABLE        as is_nullable
,      CHARACTER_SET_NAME as character_set_name
,      COLLATION_NAME     as collation_name
,      EXTRA              as extra
from   information_schema.COLUMNS
where  TABLE_SCHEMA = %s
and    TABLE_NAME   = %s
order by ORDINAL_POSITION',
                   self::$dl->quoteString($schemaName),
                   self::$dl->quoteString($tableName));

    return self::$dl->executeRows($sql);
  }
413251
public function getColumnValues($columnName = 'PrimaryKey')
    {
        $ret = [];
        $keyGetterMethod = 'get' . ucfirst($columnName);
        foreach ($this as $obj) {
            $ret[] = $obj->$keyGetterMethod();
        }

        return $ret;
    }
413602
public function getValue($row, $col)
    {
        $returnValue = null;
        $data = $this->getData();
        if (isset($data[$row][$col])) {
            $returnValue = $data[$row][$col];
        } else if (isset($data[$row]) && is_string($col)) {
            // try to access by col name.
            $mapping = $this->getColumnMapping();
            for ($i = 0; $i < count($mapping); $i++) {

                if ($mapping[$i] == $col && isset($data[$row][$col])) {
                    // Column with name $col extists.
                    $returnValue = $data[$row][$col];
                }
            }
        } else {
            throw new InvalidArgumentException("No value at ${row},${col}.");
        }
        return $returnValue;
    }
105353
protected function getDataByColumn($data, $columns)
    {
        if (is_string($columns)) {
            return array_get($data, $columns);
        }

        if (is_array($columns)) {
            $value = [];
            foreach ($columns as $name => $column) {
                if (!array_has($data, $column)) {
                    continue;
                }
                $value[$name] = array_get($data, $column);
            }

            return $value;
        }
    }