Php/docs/ds-map.hasvalue

提供:Dev Guides
< Php
移動先:案内検索

Ds\Map::hasValue

(PECL ds >= 1.0.0)

Ds\Map::hasValueDetermines whether the map contains a given value


説明

public Ds\Map::hasValue ( mixed $value ) : bool

Determines whether the map contains a given value.


パラメータ

value
The value to look for.


返り値

Returns true if the value could found, false otherwise.


例1 Ds\Map::hasValue() example

<?php$map = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);var_dump($map->hasValue(1)); // truevar_dump($map->hasValue(4)); // false?>

上の例の出力は、 たとえば以下のようになります。


bool(true)
bool(false)