Easy Map

../_images/easy_map.png

array_column() extracts a property or an index in an array of objects or arrays. It also accepts null as second argument: this represents the original object or array, as a whole.

Combined with the third argument, it makes a convenient one-liner to build a map, based on a list of objects or arrays.

See Also

PHP Features