getBit

PHP Redis

getBit

Description

Return a single bit out of a larger string

Parameters

keyoffset

Return value

LONG: the bit value (0 or 1)

Example
$redis->set('key', "\x7f"); // this is 0111 1111
$redis->getBit('key', 0); /* 0 */
$redis->getBit('key', 1); /* 1 */