Download the PHP package binary-cube/dot-array without Composer
On this page you can find all versions of the php package binary-cube/dot-array. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download binary-cube/dot-array
More information about binary-cube/dot-array
Files in binary-cube/dot-array
Package dot-array
Short Description Navigate through array using JSON Dot notation path.
License MIT
Informations about the package dot-array
PHP Dot-Array :: Sail through array using the dot notation
~ Enjoy your :coffee: ~
Accessing PHP Arrays via DOT notation is easy as:
Installing
-
via "composer require":
-
via composer (manually):
If you're using Composer to manage dependencies, you can include the following in your
composer.json
file:
Usage
REMEMBER: YOU NEED TO KNOW YOUR DATA
DotArray::get() can return a new instance of DotArray in case the accessed path is an array or it will return the raw data value or the default given value
-
instantiation:
-
get:
-
get :: more-complex:
-
set:
-
clear (empty array <=> []):
Set the contents of a given key or keys to the given value (default is empty array).
-
delete (unset(...)):
Delete the given key or keys.
-
merge:
Merges one or more arrays into master recursively.
If each array has an element with the same string key value, the latter will overwrite the former (different from array_merge_recursive).
Recursive merging will be conducted if both arrays have an element of array type and are having the same key.
For integer-keyed elements, the elements from the latter array will be appended to the former array. -
find:
Find the first item in an array that passes the truth test, otherwise return false.
The signature of the callable must be:function ($value, $key)
. -
filter:
Use a callable function to filter through items.
The signature of the callable must be:function ($value, $key)
-
filterBy:
-
where:
-
toArray:
Getting the internal raw array.
-
toJson:
Getting the internal raw array as JSON.
-
toFlat:
Flatten the internal array using the dot delimiter, also the keys are wrapped inside {key} (1 x curly braces).
Data Sample:
Bugs and feature requests
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Contributing guidelines
All contributions are more than welcomed. Contributions may close an issue, fix a bug (reported or not reported), add new design blocks, improve the existing code, add new feature, and so on. In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. Read the full Code of Conduct.
Versioning
Through the development of new versions, we're going use the Semantic Versioning.
Example: 1.0.0
.
- Major release: increment the first digit and reset middle and last digits to zero. Introduces major changes that might break backward compatibility. E.g. 2.0.0
- Minor release: increment the middle digit and reset last digit to zero. It would fix bugs and also add new features without breaking backward compatibility. E.g. 1.1.0
- Patch release: increment the third digit. It would fix bugs and keep backward compatibility. E.g. 1.0.1
Authors
- Banciu N. Cristian Mihai
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
All versions of dot-array with dependencies
ext-json Version *
ext-mbstring Version *