🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## sUnion ##### *Description* Performs the union between N sets and returns it. 执行一个并集操作在N个SET容器之间,并返回结果。 ##### *Parameters* *Keys*: key1, key2, ... , keyN: Any number of keys corresponding to sets in redis. ##### *Return value* *Array of strings*: The union of all these sets. 返回一个数组 ##### *Example* ``` <pre class="calibre16">$redis->delete('s0', 's1', 's2'); $redis->sAdd('s0', '1'); $redis->sAdd('s0', '2'); $redis->sAdd('s1', '3'); $redis->sAdd('s1', '1'); $redis->sAdd('s2', '3'); $redis->sAdd('s2', '4'); var_dump($redis->sUnion('s0', 's1', 's2')); ``` Return value: all elements that are either in s0 or in s1 or in s2. ``` <pre class="calibre16">array(4) { [0]=> string(1) "3" [1]=> string(1) "4" [2]=> string(1) "1" [3]=> string(1) "2" } ``` ##