Documentation

ICollection

Interface for associative arrays

Table of Contents

Methods

Add()  : mixed
Add a key-value pair; if the key already exists, it will be replaced.
Delete()  : bool
Remove a key and its associated value from the array.
Exists()  : bool
Checks if a key exists in the array.
Item()  : mixed
Return the value associated with the given key.
ItemAt()  : mixed
Return the value at the specified index.
Key()  : string|null
Return the key at the specified index.
ToArray()  : array<string|int, mixed>
Return the data as a regular array.
ToString()  : string
Convert to a string with specified delimiters.

Methods

Add()

Add a key-value pair; if the key already exists, it will be replaced.

public Add(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed

Delete()

Remove a key and its associated value from the array.

public Delete(string $key) : bool
Parameters
$key : string
Return values
bool

Exists()

Checks if a key exists in the array.

public Exists(string $key) : bool
Parameters
$key : string
Return values
bool

Item()

Return the value associated with the given key.

public Item(string $key) : mixed
Parameters
$key : string

ItemAt()

Return the value at the specified index.

public ItemAt(int $index) : mixed
Parameters
$index : int

Key()

Return the key at the specified index.

public Key(int $index) : string|null
Parameters
$index : int
Return values
string|null

ToArray()

Return the data as a regular array.

public ToArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

ToString()

Convert to a string with specified delimiters.

public ToString([array<string|int, string>|null $splitters = null ]) : string
Parameters
$splitters : array<string|int, string>|null = null
Return values
string

        
On this page

Search results