PHP code example of hodokami / palrcon

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

    

hodokami / palrcon example snippets




$host = 'server.palworld.com'; // Server host name or IP
$port = 25575;                      // Port rcon is listening on
$password = 'server-admin-password'; // rcon.password setting set in server.properties
$timeout = 3;                       // How long to timeout.

use Hodokami\Rcon;

$rcon = new Rcon($host, $port, $password, $timeout);

if ($rcon->connect())
{
  $rcon->sendCommand("say Hello World!");
}