PHP code example of mmeyer2k / predis-multi
1. Go to this page and download the library: Download mmeyer2k/predis-multi 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/ */
mmeyer2k / predis-multi example snippets
use \mmeyer2k\PredisMulti\PredisMulti;
$redis = new \Predis\Client();
$multi = PredisMulti::exec($redis, function() {
$redis->incr('key');
$redis->incr('key');
$redis->incr('key');
});
# $multi = [1, 2, 3]
$multi = PredisMulti::exec($redis, function() {
$redis->touch('this-key-will-never-be-created');
return false;
});