PHP code example of stefna / prefixed-redis

1. Go to this page and download the library: Download stefna/prefixed-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/ */

    

stefna / prefixed-redis example snippets


$redis = new \Stefna\Redis\PrefixedRedis('prefix.');
$redis->set('a', 'b'); // sets "prefix.a" to "b"
$redis->flushDb(); // removes all keys in database with keys like 'prefix.*'
// Same as:
$redis->deleteAll();
// And (for now at least)
$redis->flushAll(); // Does not run on all databases (only current)