PHP code example of icy8 / event-pusher
1. Go to this page and download the library: Download icy8/event-pusher 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/ */
icy8 / event-pusher example snippets
$pusher = new Pusher("http://127.0.0.1:9002");
// 通过channel发送给客户端
$pusher->trigger('event_name', 'channel', 'data');
// 广播
$pusher->broadcast('event_name', 'data');