PHP code example of workerman / phpsocket.io-emitter
1. Go to this page and download the library: Download workerman/phpsocket.io-emitter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
workerman / phpsocket.io-emitter example snippets
$emitter = new Emitter();
$emitter->in('one room')->emit('newmsg', 'hello');
$emitter->emit('newmsg', array('type'=>'blog','content'=>'.....'));