1. Go to this page and download the library: Download webdcg/redis library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webdcg / redis example snippets
$redis = new Webdcg\Redis\Redis;
// Count set bits in a string
$redis->bitCount('key');
$redis->bitField('key');
$redis->bitPos('key');
$redis->bitOp('key');
$redis->getBit('key');
$redis->setBit('key');
// Simple key -> value set
$redis->set('key', 'value');
// Will redirect, and actually make an SETEX call
$redis->set('key', 'value', 10);
// Will set the key, if it doesn't exist, with a ttl of 10 seconds
$redis->set('key:'.time(), 'value', ['nx', 'ex' => 10]);
// Will set a key, if it does exist, with a ttl of 1000 miliseconds
$redis->set('key', 'value', ['xx', 'px' => 1000]);
$redis->setEx('key', 10, 'value');