PHP code example of rdisme / redis

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

    

rdisme / redis example snippets




redis\Rredis;


$config = array(
    'host' => 'redis'
);
$redis = Rredis::getInstance($config);


// 命令详情,请点击下方链接
// https://www.w3cschool.cn/redis/


$key = 'test';

// $ret = $redis->get($key);
// $ret = $redis->setex($key, 60, $key);
$ret = $redis->multi($key);

var_dump($ret);