Usephul

Collection extends Countable, IteratorAggregate

A Collection represents a group of objects, known as its elements.

Some collections allow duplicate elements and others do not. Some are ordered, and others are unordered.

Collections that have a defined order generally implement Sequence.

Table of Contents

Methods

contains()  : bool
Checks if a value exists.

Methods

contains()

Checks if a value exists.

public contains(mixed $needle[, bool $strict = false ]) : bool

Searches for needle using loose comparison unless strict is set.

Parameters
$needle : mixed

The searched value.

Note:

If needle is a string, the comparison is done in a case-sensitive manner.

$strict : bool = false

If the third parameter strict is set to true then the ArrayMap::contains() function will also check the types of the needle in this Map.

Return values
bool

Returns true if needle is found in this Map, false otherwise.


        
On this page

Search results