socket.io-php-emitter
socket.io-php-emitter copied to clipboard
Check if room exists/if anyone is in room
Is there a way to check whether or not a room exists before using emitter->to(room)->emit()
? If there's no one in room
then i'd like PHP to execute a different script, is there any way to handle this??
You can simply check like this
socketio.sockets.adapter.rooms[roomId]
This returns you a object with sId e.g.
{"1sEAEIZeuMgdhF35AAAA":true}