Download the PHP package lablnet/arrays without Composer
On this page you can find all versions of the php package lablnet/arrays. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package arrays
Note This package is a part of ZEST Franewrk (https://github.com/zestframework/Zest_Framework/blob/master/src/Data/Arrays.php), may thanks to @peter
NO PR WILL BE ACCPETED HERE
A class to manipulate arrays in efficient ways to solve real world problems.
Requirement
- PHP 7.2 or grater.
- Composer.
Installation
Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run:
composer require lablnet/arrays
Features
- Determine whether the given dataSet is really array?
- Example:
-
Determine the given array is (sequential)indexes.?
- Example:
-
Determine the given array is assoc.?
- Example:
-
Determine the given array is multi-dimensional.?
- Example:
- Get the type of array.
- Example:
-
Add an element to an array using "operation" notation if it doesn't exist.
- Example:
- Set an array item to a given value using "operator" notation.
- Example:
-
Get an item from an array using "operator" notation(The
Arrays::get
method retrieves a value from a deeply nested array using "dot" notation:).- Example:
-
The
Arrays::get
method also accepts a default value, which will be returned if the specific key is not found.
- Determine if an item or items exist in an array using 'Operator' notation.
- Example:
-
Determine if an item or items exist in an array using 'Operator' notation.
- Example:
-
Converted a multi-dimensional associative array with
dot
.- Example:
-
Converted a multi-dimensional associative array with
operator
.- Example:
-
Push an item onto the beginning of an array.
- Example:
-
Push an item to the end of array.
- Example:
-
Get the unique elements from arrays.
- Example:
-
Get a subset of the items from the given array.
- Example:
-
Remove one or many array items from a given array using "operator" notation.
- Example:
-
Get all of the given array except for a specified array of keys.
- Example:
- Example:
-
Get a value from the array, and remove it.
- Example:
-
Changes the case of all keys in an array.
- Example:
- Changes the case of all values in an array.
- Example:
-
Remove duplicate values from array.
- Example:
- `
$name = Arrays::removeDuplicates($array);
// $array: ['red', 'green', 'blue']
-
Get the most occurring value from array.
- Example:
-
Get the least occurring value from array.
- Example:
-
Convert the array into a query string.
- Example:
-
Filter the array using the given callback (THIS METION WILL NOT WORKS WITH MULTIDIMESSIONAL ARRAY.).
- Example:
-
Get one or a specified number of random values from an array.
- Example:
- Get multiple values of same keys from multi-dimessional array.
- Example: