dq5studios / entity_column
array_column() 的替代品,支持具有属性的对象。
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-09-25 07:21:58 UTC
README
entity_column
是 array_column()
的替代品,支持具有属性的对象。
使用方法
use function DQ5Studios\EntityColumn\entity_column; function entity_column(array $array, int|string $column_key, int|string|null $index_key = null): array
参数
array
一个多维数组或从其中提取值列的对象数组。
column_key
要返回的值列。
index_key
用作返回数组索引/键的列。
返回值
返回一个表示输入数组中单个列的值数组的数组。