A utility for traversing arrays using dot notation
$ composer require p810/dot
<?php
p810\Dot\find('foo.bar', [
'foo' => [
'bar' => 'Hello world!'
]
]);
#=> string(12) "Hello world!"
Searches an array for a value based on a dot notated string of keys
Argument | Type | Default | Description |
---|---|---|---|
$needle |
string |
n/a | A dot separated list of keys |
$haystack |
array |
n/a | The array to traverse |
💡
p810\Dot\search()
is an alias for this function
Returns a list of keys from a dot notated string
Argument | Type | Default | Description |
---|---|---|---|
$keys |
string |
n/a | A dot separated list of keys |
This package is released under the MIT License.