sIsMember, sContains

PHP Redis

sIsMember, sContains

Description

Checks if value is a member of the set stored at the key key.

检查VALUE是否是SET容器中的成员。

Parameters

key value

Return value

BOOL TRUE if value is a member of the set at key keyFALSE otherwise.

Example
$redis->sAdd('key1' , 'member1');
$redis->sAdd('key1' , 'member2');
$redis->sAdd('key1' , 'member3'); /* 'key1' => {'member1', 'member2', 'member3'}*/

$redis->sIsMember('key1', 'member1'); /* TRUE */
$redis->sIsMember('key1', 'memberX'); /* FALSE */