企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## setBit ##### *Description* Changes a single bit of a string. ##### *Parameters* *key**offset* *value*: bool or int (1 or 0) ##### *Return value* *LONG*: 0 or 1, the value of the bit before it was set. ##### *Example* ``` <pre class="calibre16">$redis->set('key', "*"); // ord("*") = 42 = 0x2f = "0010 1010" $redis->setBit('key', 5, 1); /* returns 0 */ $redis->setBit('key', 7, 1); /* returns 0 */ $redis->get('key'); /* chr(0x2f) = "/" = b("0010 1111") */ ``` ##