/**
 * This example gets information about a list of domain names.
 *
 * @copyright Copyright 2011 TransIP BV
 * @author TransIP BV <*****@*****.**>
 */
require_once '../Transip/DomainService.php';
if (isset($_GET['domains']) && strlen($_GET['domains']) > 0) {
    /** @var string[] $domainNames A list of domain names. */
    $domainNames = explode("\n", $_GET['domains']);
    $domainNames = array_filter($domainNames, 'trim');
    try {
        // Request information about a domain in your account by using the TransIP
        // DomainService API; A domain Object will be returned holding all
        // information available about the domain.
        $domains = Transip_DomainService::batchGetInfo($domainNames);
        // INFO: A domain object holds all data directly available for a domain:
        //		 + it has a list of nameservers,
        //		 + a list of whois-contacts
        //		 + a list of dns-entries if the domain is using TransIP nameservers
        //		 + and, optionally, a Transip_DomainBranding object that holds
        //			information about branding (see reseller info for more)
        //
        // The domain object does not include registrar-lock and auth/epp-code
        // information, since this information will always be fetched real-time
        // from the registry. To get this information, you can use the
        // getIsLocked() and getAuthCode API calls.
        $result = "We got the following information about these domains:\n" . htmlspecialchars(implode(",\n", $domainNames)) . "\n\n";
    } catch (SoapFault $e) {
        // It is possible that an error occurs when connecting to the TransIP Soap API,
        // those errors will be thrown as a SoapFault exception.