PHP theorytheory 0/50 · 0%
Arrays · easy

6. Array Functions

Manipulating arrays functionally.

PHP offers a rich standard library for arrays: array_map(), array_filter(), and array_reduce() apply functions across elements without manual loops. sort(), usort(), and ksort() handle ordering.

These functions favor a functional style and often accept closures or callable strings as arguments.

Check your understanding

  1. 1. Which function transforms every element of an array?

  2. 2. Which function removes elements not matching a condition?