Anemone::jsonSerialize()

Returns the data to be serialized as JSON.

Table of Contents
  1. Description
  2. Example

Description

Anemone::jsonSerialize(): mixed;

This method is a requirement to be able to implement the JsonSerializable interface and aims to make the data convertable to JSON. You won’t use this method directly, the json_encode() function will call this method automatically.

Example

$anemone = new Anemone([1, 2, 'a', ['b' => true]]);

echo json_encode($anemone); // Returns `'{"join":", ","lot":[1,2,"a",{"b":true}],"parent":null,"value":[1,2,"a",{"b":true}]}'`

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

Returns the data to be serialized as JSON.

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.