dq5studios / entity_column
A drop-in replacement for array_column() that supports objects with getters.
v1.0.0
2023-05-25 04:08 UTC
Requires
- php: >=7.4
- symfony/property-access: ^5.4 || ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.17
- phpunit/phpunit: ^9.0
- vimeo/psalm: ^5.12
This package is auto-updated.
Last update: 2024-10-25 07:31:27 UTC
README
entity_column
A drop-in replacement for array_column()
that supports objects with getters.
Usage
use function DQ5Studios\EntityColumn\entity_column; function entity_column(array $array, int|string $column_key, int|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.