PHP code example of bdk / wamp-publisher
1. Go to this page and download the library: Download bdk/wamp-publisher 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/ */
bdk / wamp-publisher example snippets
bdk\WampPublisher;
$wamp = new \bdk\WampPublisher(array(
'url' => 'ws://127.0.0.1:9090/',
'realm' => 'myRealm',
));
$wamp->publish('my.topic', array("I'm published to the my.topic topic"));
$sum = 1 + 1; // WAMP Publisher doesn't block you from doing other tasks
$wamp->publish('my.topic', array("Another message"));