PHP code example of kasperhartwich / quickdns

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

    

kasperhartwich / quickdns example snippets



ckDns = new \QuickDns\QuickDns('[email protected]','password');

$domains = <<<EOD
domain1.dk
domain2.dk
domain3.dk
EOD;

$template = $quickDns->getTemplate('my-template');

$domains = explode(PHP_EOL, $domains);
foreach ($domains as $domain) {
    $zone = new \QuickDns\Zone($quickDns, $domain);
    $zone->create();
    echo $zone->domain . ' created' . PHP_EOL;

    $zone = $quickDns->getZone($domain);
    $template->addZone($zone);
    echo $zone->domain . ' added to template ' . $template->name . PHP_EOL;
}
echo 'Done' . PHP_EOL;