PHP code example of cloudadic / php-ejabberd

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

    

cloudadic / php-ejabberd example snippets




jabberd\Client;

$client = Client([
  'port' => 5285,
  'host' => '192.178.12.1',
  'apiEndPoint' => 'your_endpoint'
]);




// Add User
$user = '[email protected]';
$client->addUser($user);

// Ban Account
$user = '[email protected]';
$reason = 'Acting too smart';
$client->banAccount($user, $reason);
bash
composer