Function __global->array_column
Definitions
sources_custom/phpstub.php
- Return the values from a single column in the input array.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $input | array | No | No | required parameter | N/A | N/A | A multi-dimensional array or an array of objects from which to pull a column of values from |
| $column_key | mixed | No | No | required parameter | N/A | N/A | The column of values to return |
| $index_key | ?mixed | No | No | Null | N/A | N/A | The column to use as the index/keys for the returned array (null: numeric sequential indices) |
Returns
- Collapsed values
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Return the values from a single column in the input array.
*
* @param array $input A multi-dimensional array or an array of objects from which to pull a column of values from
* @param mixed $column_key The column of values to return
* @param ?mixed $index_key The column to use as the index/keys for the returned array (null: numeric sequential indices)
* @return array Collapsed values
*/
function array_column(array $input, $column_key, $index_key = null) : array
* Return the values from a single column in the input array.
*
* @param array $input A multi-dimensional array or an array of objects from which to pull a column of values from
* @param mixed $column_key The column of values to return
* @param ?mixed $index_key The column to use as the index/keys for the returned array (null: numeric sequential indices)
* @return array Collapsed values
*/
function array_column(array $input, $column_key, $index_key = null) : array

