NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
## sMembers, sGetMembers ##### *Description* Returns the contents of a set. 返回SET集合中的所有元素。 ##### *Parameters* *Key*: key ##### *Return value* An array of elements, the contents of the set. ##### *Example* ``` <pre class="calibre16">$redis->delete('s'); $redis->sAdd('s', 'a'); $redis->sAdd('s', 'b'); $redis->sAdd('s', 'a'); $redis->sAdd('s', 'c'); var_dump($redis->sMembers('s')); ``` Output: ``` <pre class="calibre16">array(3) { [0]=> string(1) "c" [1]=> string(1) "a" [2]=> string(1) "b" } ``` The order is random and corresponds to redis' own internal representation of the set structure. 结果集的顺序是随机的,这也符合Redis本身对SET数据结构的定义。不重复,无顺序的集合。