library dot
A utility for traversing arrays using dot notation.
p810/dot
A utility for traversing arrays using dot notation.
- Friday, October 28, 2016
- by p810
- Repository
- 1 Watchers
- 0 Stars
- 14 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 5 Versions
- 27 % Grown
Dot
A utility for traversing arrays using dot notation, (*1)
Installation
$ composer require p810/dot
Example usage
<?php
p810\Dot\find('foo.bar', [
'foo' => [
'bar' => 'Hello world!'
]
]);
#=> string(12) "Hello world!"
API
p810\Dot\find(string $needle, array $haystack): mixed
Searches an array for a value based on a dot notated string of keys, (*2)
Argument |
Type |
Default |
Description |
$needle |
string |
n/a |
A dot separated list of keys |
$haystack |
array |
n/a |
The array to traverse |
:bulb: p810\Dot\search()
is an alias for this function, (*3)
p810\Dot\getKeysFromString(string $keys): array<int,string|int>
Returns a list of keys from a dot notated string, (*4)
Argument |
Type |
Default |
Description |
$keys |
string |
n/a |
A dot separated list of keys |
License
This package is released under the MIT License., (*5)
dev-master
9999999-dev
A utility for traversing arrays using dot notation.
Sources
Download
MIT
by
Lily
v2.0.0
2.0.0.0
A utility for traversing arrays using dot notation.
Sources
Download
MIT
by
Lily
v1.0.3
1.0.3.0
A utility for traversing arrays using dot notation.
Sources
Download
MIT
by
Payton
v1.0.1
1.0.1.0
A utility for traversing arrays using dot notation.
Sources
Download
MIT
by
Payton
v1.0
1.0.0.0
A utility for traversing arrays using dot notation.
Sources
Download
MIT
by
Payton