stellarwp / arrays
A library for array manipulation.
Installs: 754 111
Dependents: 4
Suggesters: 0
Security: 0
Stars: 5
Watchers: 5
Forks: 0
pkg:composer/stellarwp/arrays
Requires (Dev)
- lucatume/wp-browser: ^3.5 || ^4.0
- saggre/phpdocumentor-markdown: ^0.1.3
- symfony/event-dispatcher-contracts: ^2.5.1
- symfony/string: ^5.4
- szepeviktor/phpstan-wordpress: ^1.1
README
A library for array manipulations.
Table of contents
- Installation
- Notes on examples
- Array utils
- accessible
- add
- add_prefixed_keys_to
- add_unprefixed_keys_to
- array_visit_recursive
- collapse
- destringify_keys
- dot
- escape_multidimensional_array
- except
- exists
- filter_to_flat_scalar_associative_array
- filter_prefixed
- first
- flatten
- forget
- get
- get_first_set
- get_in_any
- has
- insert_after_key
- insert_before_key
- intersect_key_recursive
- is_assoc
- is_list
- join
- last
- list_to_array
- map_or_discard
- merge_recursive
- merge_recursive_query_vars
- only
- parse_associative_array_alias
- prepend
- pull
- query
- random
- recursive_ksort
- remove_numeric_keys_recursive
- remove_string_keys_recursive
- set
- shape_filter
- shuffle
- sort_by_priority
- sort_recursive
- sort_recursive_desc
- stringify_keys
- strpos
- to_list
- undot
- usearch
- where
- where_not_null
- wrap
 
- Acknowledgements
Installation
It's recommended that you install Arrays as a project dependency via Composer:
composer require stellarwp/arrays
We actually recommend that this library gets included in your project using Strauss.
Luckily, adding Strauss to your
composer.jsonis only slightly more complicated than adding a typical dependency, so checkout our strauss docs.
Notes on examples
Since the recommendation is to use Strauss to prefix this library's namespaces, all examples will be using the Boomshakalaka namespace prefix.
Acknowledgements
A number of array methods were ported over from The Events Calendar and the Laravel Framework.