PHP code example of dustindoiron / srs-registrar

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

    

dustindoiron / srs-registrar example snippets


use SrsRegistrar\Resources\Domains\Lookup;
use SrsRegistrar\Service;
use SrsRegistrar\Configuration;

$configuration = new Configuration('apiKey', 'username', 'endpoint');
$service = new Service($configuration);

$lookup = new Lookup($service);

$parameters = [
    'domain' => 'dustindoiron.com',
    'no_cache' => 1,
];

$lookup->createRequestFromArray($parameters)->send();

$response = $lookup->getXmlService()->getResponseDocumentBody();
/**
  SimpleXMLElement {#8574
    +"item": [
      "211",
      "Domain taken",
      SimpleXMLElement {#8570
        +"@attributes": [
          "key" => "attributes",
        ],
        +"dt_assoc": SimpleXMLElement {#8568
          +"item": "taken",
        },
      },
      "DOMAIN",
      "1",
      "REPLY",
      "XCP",
    ],
  }
*/