PHP code example of lkdevelopment / hetzner-cloud-php-sdk
1. Go to this page and download the library: Download lkdevelopment/hetzner-cloud-php-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/ */
lkdevelopment / hetzner-cloud-php-sdk example snippets
php
$hetznerClient = new \LKDev\HetznerCloud\HetznerAPIClient($apiKey);
foreach ($hetznerClient->servers()->all() as $server) {
echo 'ID: '.$server->id.' Name:'.$server->name.' Status: '.$server->status.PHP_EOL;
}