PHP code example of upsub / client
1. Go to this page and download the library: Download upsub/client 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/ */
upsub / client example snippets
use UpSub\Client;
$client = new Client('http://localhost:4400', [
// options
]);
// Single channel
$channel = $client->channel('channel');
// Multiple channels
$multiChannel = $client->channel('channel-1', 'channel-2');
// Send message from the channel
$channel->send('event', [ 'key' => 'value' ]);
// Send message directly from client
$client->send('event', 'my message...');