Skip to content

Releases: dimsog/arrayhelper

1.2.3

13 Dec 13:41

Choose a tag to compare

Arr::wrap()

Wrap a value to array

1.2.2

04 Oct 17:11

Choose a tag to compare

ArrayHelper::get() or Arr::get()

Alias for ArrayHelper::getValue()

Allow ArrayHelper::get(null, $key)

Sorting

ArrayHelper::sortBy(array $array, $key = null, $direction = 'ASC');
ArrayHelper::sortByAsc(array $array, $key = null);
ArrayHelper::sortByDesc(array $array, $key = null);

1.2.1

27 Aug 06:51

Choose a tag to compare

ArrayHelper::chunk()

  • Split an array into columns

1.2.0

04 Jun 07:45

Choose a tag to compare

ArrayHelper::exist()

  • This method checks exist or not value by key, value or callable

Improvements:

Refactoring for ArrayHelper::filter() method

1.1.9

18 May 09:20

Choose a tag to compare

ArrayHelper::findFirst()

  • Find a first array item from an array

Improvements:

  • Now getValue() method also supported a stdClass

1.1.8

15 May 11:01

Choose a tag to compare

ArrayHelper::ids()

  • This method will return all of id values from the input array.
    This is alias for ArrayHelper::column($array, 'id');

ArrayHelper::prepend()

  • This method will push an item on the beginning of an array.

1.1.7

26 Apr 12:20

Choose a tag to compare

ArrayHelper::unique()

  • Removes duplicate values from an array

1.1.6

17 Apr 11:30

Choose a tag to compare

ArrayHelper::firstKey()

  • Get the first key of the given array

ArrayHelper::lastKey()

  • Get the last key of the given array

ArrayHelper::onlyWithKey()

Get a subset of the items from the given array with key $key

1.1.5

11 Apr 09:51

Choose a tag to compare

ArrayHelper::has()

  • This method checks a given key exist in an array.

ArrayHelper::set()

  • Set a value into an array using "dot" notation

1.1.4

10 Apr 15:19

Choose a tag to compare

ArrayHelper::collapse()

  • Collapse an array of arrays into a single array

ArrayHelper::values()

  • Flattens a multidimensional array into an single (flat) array

ArrayHelper::sum()

  • Calculate the sum of values in an array with a specific key

ArrayHelper::map()

  • Applies the callback to the elements of the given array

ArrayHelper::remove()

  • Removes a given key (or keys) from an array using dot notation

Other improvements

  • Added: Arr::* format