PHP code example of dtkahl / php-simple-redis-cache

1. Go to this page and download the library: Download dtkahl/php-simple-redis-cache 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/ */

    

dtkahl / php-simple-redis-cache example snippets


$cache = new Cache([
    "scheme" => "tcp",
    "host => "127.0.0.1",
    "port" => 6379
);

$cache->put('foo', 'bar', 60)

$cache->has('foo')

$cache->get('foo', 'default')

$cache->forget('foo')

$cache->forever('foo', 'bar')

$cache->put('foo')

composer