Follow me on twitter…


Sets are also friendly to use - you can use set just like as it's a PHP array:


// Initialize Rediska
$rediska = new Rediska();

// Initialize set
$set = new Rediska_Key_Set('set');

// Add two elements to set
$set[] = 'first element';
$set[] = 'second element';

// Get elements count
echo count($set); #=> 2

// check if element is in set
$isInSet = $set->exists('first element'); #=> true

// Iterate set
foreach($set as $element) {
    echo $element;


See all available methods.


Fork me on GitHub