# Gateway::getClientIdListByGroup ## 说明: ```php array Gateway::getClientIdListByGroup(mixed $group); ``` ``` (要求Gateway版本>=3.0.8) ``` [如何查看Gateway版本](get-gateway-version.md) 获取某个分组所有在线client_id列表。 ## 返回值 返回client_id为key同时client_id也为值的数组。 类似下面的格式 ```php array( '7f00000108fc00000008' => '7f00000108fc00000008', '7f00000108fc00000009' => '7f00000108fc00000009' ) ``` ## 范例 ```php use \GatewayWorker\Lib\Gateway; class Events { ... public onMessage($client_id, $message) { $group = 'room-1'; $_SESSION['name'] = $message['name']; $_SESSION['sex'] = $message['sex']; Gateway::joinGroup($client_id, $group); var_export(Gateway::getClientIdListByGroup($group)); } ... } ``` 打印出的数据类似如下: ```php array( '7f00000108fc00000008' => '7f00000108fc00000008', '7f00000108fc00000009' => '7f00000108fc00000009' ) ```