PHP code example of carmelosantana / porkbun-sdk

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

    

carmelosantana / porkbun-sdk example snippets


$domain = new PorkbunSdk\Domain('your_api_key', 'your_secret_api_key');

$response = $domain->updateNameServers('example.com', [
    'ns1.example.com',
    'ns2.example.com'
]);

print_r($response);

$dns = new PorkbunSdk\DNS('your_api_key', 'your_secret_api_key');

$response = $dns->createRecord('example.com', 'A', '1.1.1.1', 'www');

print_r($response);

$ssl = new PorkbunSdk\SSL('your_api_key', 'your_secret_api_key');

$response = $ssl->getCertificate('example.com');

print_r($response);