PHP code example of tinson / redis-client

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

    

tinson / redis-client example snippets


        $config = [
            'host' => '127.0.0.1', //optional, default: 127.0.0.1
            'port' => 6379, //optional, default: 6379
            'timeout' => 1, //optional,default: 1ms
            'password' => null, //optional, default: null
            'db' => 10, //optional, default: null
        ];
        $client = new \SimpleRedis\Client($config);
        $client->set("test", 1);
        $res = $client->get("test");
        var_dump($res);