Extracts a column from an array of arrays or objects

@param   array   $array  The source array
@param   string  $index  The index of the column or name of object property

@return  array  Column of values from the source array

@since   1.0
480789
public static function getColumn(array $array, $index)
	{
		$result = array();

		foreach ($array as $item)
		{
			if (is_array($item) && isset($item[$index]))
			{
				$result[] = $item[$index];
			}
			elseif (is_object($item) && isset($item->$index))
			{
				$result[] = $item->$index;
			}
		}

		return $result;
	}
531641
public function column($index = 0)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetchAll(PDO::FETCH_COLUMN, $index);
        } else {
            return false;
        }
    }
1163453
public static function indexToQuads(array $index) {
    $quads = array();
    foreach ($index as $subject => $predicates) {
      foreach ($predicates as $predicate => $objects) {
        foreach ($objects as $object) {
          $quads[] = new Quad(new IRI($subject),
            new IRI($predicate),
            ($object['type']!='literal')
              ? new IRI($object['value']) : new TypedValue($object['value'],
            (isset($object['datatype']) && $object['datatype']!='')
              ? $object['datatype'] : RdfConstants::XSD_STRING));
        }
      }
    }
    return $quads;
  }
1164492
public function arrayCopy(array $array)
    {
        $copy = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $copy[ $key ] = $this->arrayCopy($value);
            } elseif (is_object($value)) {
                $copy[ $key ] = clone $value;
            } else {
                $copy[ $key ] = $value;
            }
        }

        return $copy;
    }
1042442
public function ExtractDistinctValues($array) {
        foreach ($array as $key => $value) {
            $valueIsArray = is_array($value);
            $valueIsAlreadyExtracted = in_array($value, $this->List);
            $keyIsExtracted = in_array($key, $this->List);
            if (!$valueIsArray && !$valueIsAlreadyExtracted && !RegexHelper::Init($value)->StringContainsWhiteSpace()) {
                array_push($this->List, $value);
            }
            if (!$keyIsExtracted && is_string($key) && !RegexHelper::Init($key)->StringContainsWhiteSpace()) {
                array_push($this->List, $key);
            }
            if ($valueIsArray) {
                $this->ExtractDistinctValues($value);
            }
        }
        return $this;
    }
1310871
public static function getIndexOf(array $array, $element)
    {
        // No elements?
        // Nothing to do
        if (empty($array)) {
            return false;
        }

        foreach ($array as $index => $value) {
            if ($value === $element) {
                return $index;
            }
        }

        return null;
    }
473493
protected function getIndexColumnListDDL(Index $index)
    {
        $list = array();
        foreach ($index->getColumns() as $col) {
            $list[] = $this->quoteIdentifier($col) . ($index->hasColumnSize($col) ? '(' . $index->getColumnSize($col) . ')' : '');
        }

        return implode(', ', $list);
    }
1348608
public function filterArray($array)
    {
        $newArray = array();

        foreach ($array as $key => $row) {
            foreach ($this->columnToFilter as $column) {
                if (!array_key_exists($column, $row)) {
                    continue;
                }

                if (self::match($this->patternToSearchQuoted, $row[$column], $this->invertedMatch)) {
                    $newArray[$key] = $row;
                    continue 2;
                }
            }
        }

        return $newArray;
    }
951289
@Nullable
	public static <T> T get(T[] array, int index) {
		return array != null && index >= 0 && index < array.length ? array[index] : null;
	}
799584
public static function column($array, $columnName)
    {
        $result = [];
        foreach($array as $row)
        {
            if(is_object($row))
            {
                $result[] = $row->$columnName;
            }
            else
            {
                $result[] = $row[$columnName];
            }
        }
        return $result;
    }
1104195
public static function insert($array, $values, $index = null)
    {
        $values = (array) AnConfig::unbox($values);
        $array = (array) AnConfig::unbox($array);
        if ($index === null) {
            foreach ($values as $value) {
                array_push($array, $value);
            }
        } else {
            array_splice($array, $index, 0, $values);
        }

        return $array;
    }
1295212
public function getArrayValue(array $array, string $key)
    {
        foreach ($this->getBoth($key) as $loopKey) {
            if (array_key_exists($loopKey, $array)) {
                return $array[$loopKey];
            }
        }
    }
110951
public function fetchColumn($index = 0): Generator
    {
        $offset = $this->getColumnIndex($index, __METHOD__.'() expects the column index to be a valid string or integer, `%s` given');
        $filter = static function (array $record) use ($offset): bool {
            return isset($record[$offset]);
        };

        $select = static function (array $record) use ($offset): string {
            return $record[$offset];
        };

        $iterator = new MapIterator(new CallbackFilterIterator($this->records, $filter), $select);
        foreach ($iterator as $offset => $value) {
            yield $offset => $value;
        }
    }
439772
public function getRow($index)
    {
        $keys = array_keys($this->rows);

        return isset($keys[$index]) ? $this->rows[$keys[$index]] : null;
    }
269952
public function copyToArray(array &$array)
    {
        $array['name']         = $this->name;
        $array['defaultEntry'] = $this->defaultEntry;
        $array['description']  = $this->description;
        $array['descriptions'] = LanguageUtility::convertArrayOfArrayCopyableToArray($this->descriptions);
        $array['attributes']   = LanguageUtility::convertArrayOfArrayCopyableToArray($this->attributes);
    }
553151
public function getRow($index = 0, $column = null)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string or int
            ->test(1, 'string', 'int')
            //Argument 2 must be a string or null
            ->test(2, 'string', 'null');
        
        if (is_string($index)) {
            $column = $index;
            $index = 0;
        }
        
        $rows = $this->getRows();
        
        if (!is_null($column) && isset($rows[$index][$column])) {
            return $rows[$index][$column];
        } else if (is_null($column) && isset($rows[$index])) {
            return $rows[$index];
        }
        
        return null;
    }
791834
private function arrayClone(array $array) {
        return array_map(function ($element) {
            return ((is_array($element))
                ? $this->arrayClone($element)
                : ((is_object($element))
                    ? clone $element
                    : $element
                )
            );
        }, $array);
    }