array_find_key
array_find_key ( $array, $callback )
Parameters:- (array) array The array to search.
- (callable) callback The callback to run for each element.
Returns:- (int|string|null) The first key in the array that passes the `$callback`, otherwise null.
Defined at: - Introduced in WordPress: 6.8.0
- Deprecated in WordPress: —
Description
Polyfill for `array_find_key()` function added in PHP 8.4.Searches an array for the first key that passes a given callback.