PHP code example of samsmithkruz / redis-client-class
1. Go to this page and download the library: Download samsmithkruz/redis-client-class 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/ */
samsmithkruz / redis-client-class example snippets
$redis = new RedisClient(); // Default: 127.0.0.1:6379
$redis->insert('username', 'john_doe', 3600); // Store for 1 hour
echo $redis->select('username'); // Output: john_doe
$redis->update('username', 'jane_doe');
$redis->delete('username');
$redis->hash_insert('user:1', 'name', 'John Doe');
echo $redis->hash_select('user:1', 'name'); // Output: John Doe