array_any


array_any ( $array, $callback )

Parameters:
  • (array) array The array to check.
  • (callable) callback The callback to run for each element.
Returns:
  • (bool) True if any element in the array passes the `$callback`, otherwise false.
Defined at:

Description

Polyfill for `array_any()` function added in PHP 8.4.Checks if any element of an array passes a given callback.

Related Functions

array_all, array_find, array_find_key, array_key_last, array_key_first

Top Google Results

User discussions

wpseek mobile