PHP code example of mollsoft / goip-client

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

    

mollsoft / goip-client example snippets


$baseURI = 'http://.../goip';
$login = 'root';
$password = '...';

$client = new \MollSoft\GoipClient\GoipClient($baseURI, $login, $password);

$goipList = $client->goipList();

/** @var \MollSoft\GoipClient\Entities\GoipItem $item */
foreach( $goipList as $item ) {
    print_r($item);
}

$inboxSMSList = $client->inboxSMS();

/** @var \MollSoft\GoipClient\Entities\InboxSMSItem $item */
foreach( $inboxSMSList as $item ) {
    print_r($item);
}

$ussdList = $client->ussdList();

/** @var \MollSoft\GoipClient\Entities\USSDItem $item */
foreach( $ussdList as $item ) {
    print_r($item);
}

$command = '*100#';
$goipList = $client->goipList();

/** @var \MollSoft\GoipClient\Entities\GoipItem $item */
foreach( $goipList as $item ) {
    $answer = $client->ussd($item->termId, $command, true);
    echo "GoIP Terminal {$item->termId}: $answer\n";
}