minwork/array
Minwork Array provides fast, well-tested helpers for nested, associative, and object arrays. Get/set/has plus map, filter, find, group, sort, and validation, with fluent-style chaining. No dependencies; modern PHP syntax.
Arr::getDepth(array $array): int
Get nesting depth of an array
Arr::getDepth([]) -> 1
Arr::getDepth([1, 2, 3]) -> 1
Arr::getDepth([1, 2 => [], 3]) -> 2
Arr::getDepth([
1,
2 => [
3 => [
4 => []
]
],
5 => []
]) -> 4
How can I help you explore Laravel packages today?