企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
## String操作 #### set ~~~ // Simple key -> value set $redis->set('key', 'value'); // Will redirect, and actually make an SETEX call $redis->set('key','value', 10); // Will set the key, if it doesn't exist, with a ttl of 10 seconds $redis->set('key', 'value', Array('nx', 'ex'=>10)); // Will set a key, if it does exist, with a ttl of 1000 miliseconds $redis->set('key', 'value', Array('xx', 'px'=>1000)); ~~~ 返回值为True是表示执行成功 #### get `$redis->get('key');` **Return value** String or Bool: If key didn't exist, FALSE is returned. Otherwise, the value related to this key is returned. #### strLen **Return value** 返回整型长度 ~~~ $redis->set('key', 'value'); $redis->strlen('key'); /* 5 */ ~~~