A::find()
Finds the first element matching the given callback
A::find(array $array, callable(mixed $value, (int|string) $key, array $array): bool $callback): mixed
Parameters
Name | Type | Default |
---|---|---|
$arrayrequired | array |
no default value |
$callbackrequired | callable(mixed $value, (int orstring) $key, array $array): bool |
no default value |
Return type
mixed
Parent class
Examples
$array = [1, 30, 39, 29, 10, 13];