Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 989 Bytes

README.md

File metadata and controls

29 lines (18 loc) · 989 Bytes

Build Status codecov shepherd

entity_column

A drop-in replacement for array_column() that supports objects with getters.

Usage

function entity_column(array $array, string $column_key, string|null $index_key = null): array

Parameters

array

A multi-dimensional array or an array of objects from which to pull a column of values from.

column_key

The column of values to return.

index_key

The column to use as the index/keys for the returned array.

Return Values

Returns an array of values representing a single column from the input array.