多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## sDiffStore ##### *Description* Performs the same action as sDiff, but stores the result in the first key 与sDiff函数功能一直,只是结果为一个新的SET集合,存储到dstkey。 ##### *Parameters* *Key*: dstkey, the key to store the diff into. Key:存储结果的SET集合KEY *Keys*: key1, key2, ... , keyN: Any number of keys corresponding to sets in redis 参与操作的SET集合 ##### *Return value* *INTEGER*: The cardinality of the resulting set, or `<span class="calibre12">FALSE</span>` in case of a missing key. 返回整数:为结果集的个数。 ##### *Example* ``` <pre class="calibre16">$redis->delete('s0', 's1', 's2'); $redis->sAdd('s0', '1'); $redis->sAdd('s0', '2'); $redis->sAdd('s0', '3'); $redis->sAdd('s0', '4'); $redis->sAdd('s1', '1'); $redis->sAdd('s2', '3'); var_dump($redis->sDiffStore('dst', 's0', 's1', 's2')); var_dump($redis->sMembers('dst')); ``` Return value: the number of elements of s0 that are neither in s1 nor in s2. ``` <pre class="calibre16">int(2) array(2) { [0]=> string(1) "4" [1]=> string(1) "2" } ``` ##