多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
// 普通 set/get 操作 ~~~ $redis->set('test:str1', 'predis'); $ret = $redis->get('test:str1'); echo $ret; ~~~ // setnx 只有在 key 不存在时设置 key 的值 ~~~ $redis->setnx('test:str3', 'str3-v'); $ret = $redis->get('test:str3'); echo $ret; ~~~ // incrby/incr/decrby/decr 对值的递增和递减 ~~~ $redis->set('test:str2', 1); $redis->incr('test:str2'); $redis->incrby('test:str2', 4); echo $redis->decr('test:str2'); echo $redis->decrby('test:str2', 2); echo $redis->get('test:str2'); ~~~