Anemone::key()

Gets item key in data by position index.

Table of Contents
  1. Description
  2. Example

Description

Anemone::key(int $index): ?string;

This method gets the key of an item based on the position index in the data. If the index does not exist in the data, this method returns null.

Example

$anemone = new Anemone([
    'a' => 1,
    'b' => 2,
    'c' => 3,
    'd' => 4,
    'e' => 5
]);

$key = $anemone->key(2); // Returns `'c'`

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::key()

Gets item key in data by position index.

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.