PHP code example of bingher / transmit

1. Go to this page and download the library: Download bingher/transmit 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/ */

    

bingher / transmit example snippets



s TransmitHandler extends \bingher\transmit\Server
{
    public function sayMsg($params)
    {
        return 'you say:' . var_export($params, true);
    }
}

$host = '0.0.0.0';
$port = 9000;

TransmitHandler::run($port, $host);


ent = new \bingher\transmit\Client('127.0.0.1', 8000);

$res = $client->sayMsg(['msg' => 'hello huangbh']);
var_dump($res);