# Gateway::getClientCountByGroup
## 說明:
~~~
int Gateway::getClientCountByGroup(mixed $group);
~~~
獲取某分組當前在線成員數(多少client_id在線)。
## 參數
* $group
分組名字
## 返回值
返回一個數字
## 范例
~~~
use \GatewayWorker\Lib\Gateway;
class Events
{
...
public onConnect($client_id)
{
$group = 'romm-1';
Gateway::joinGroup($client_id, $group);
var_export(Gateway::getClientCountByGroup($group));
}
...
}
~~~
打印出的數據類似如下:
~~~
16
~~~
- 快速入門
- 魔際客服系統V1.0簡介
- 新手上路
- 注冊并創建應用
- 通信過程及聊天記錄保存
- 實時消息回調
- Lib/Geteway類提供的接口
- sendToAll
- sendToClient
- closeClient
- isOnline
- bindUid
- unbindUid
- isUidOnline
- getClientIdByUid
- getUidByClientId
- sendToUid
- joinGroup
- leaveGroup
- sendToGroup
- getClientCountByGroup
- getClientSessionsByGroup
- getAllClientCount
- getAllClientSessions
- setSession
- updateSession
- getSession
- 服務端集成
- 入門
- 用戶體系集成
- 聊天記錄
- 文件上傳下載
- 發送消息
- 群組管理
- 聊天室管理
- 應用管理
- Web IM集成
- Web IM 介紹
- 集成方式
- Web SDK基礎功能
- 消息
- 好友管理
- 群組管理
- 聊天室管理
- 微信小程序 Demo
- Web SDK API Doc
- Web IM SDK 更新日志
- React Native集成
- React Native Demo 介紹