PHP code example of team-reflex / rcon-php
1. Go to this page and download the library: Download team-reflex/rcon-php 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/ */
team-reflex / rcon-php example snippets
use Reflex\Rcon\Rcon;
$rcon = new Rcon(':ip_address', :port, ':rcon_password');
$rcon->connect();
// Set the socket timeout if you want to, defaults to 2 seconds.
$rcon->setTimeout(:seconds);
// Execute a rcon command
$rcon->exec('say PHP!');