Anemone::reverse()

Reverses the order of the data.

Table of Contents
  1. Description
  2. Example

Description

Anemone::reverse(bool $keys = false): self;

This method reverses the order of the data.

Example

$anemone = new Anemone([1, 2, 3, 4, 5]);

test($anemone->mitose()->reverse()->get()); // Returns `[5, 4, 3, 2, 1]`
test($anemone->mitose()->reverse(true)->get()); // Returns `[4 => 5, 3 => 4, 2 => 3, 1 => 2, 0 => 1]`

You call the Anemone::get() method to return raw array values, but you can also directly iterate over it.

Anemone::any()

Checks if at least one item in the data passes the test.

Anemone::is()

Filters the data so that only items that pass the test are left.

Anemone::not()

Filters the data so that only items that do not pass the test are left.

Anemone::pluck()

Returns a new data set contains values from the key on every item.

Anemone::reverse()

Reverses the order of the data.