PHP code example of bigbug-gg / zenlayer

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

    

bigbug-gg / zenlayer example snippets




use BigbugGg\Zenlayer\Fetch;

class SimpleExample extends Fetch
{
    /**
     * @throws JsonException
     */
    public function zenlayerCallName(): array
    {
        $dataArr = $this->fetch('ZenlayerCallName', [
            // Parameters  => Values
        ]);
        // other logic codes
        return $dataArr;
    }
}

$appId = 'YOUR-APP-ID';
$secretKey = 'YOUR-SECRET-KEY';
$instance = new SimpleExample($appId, $secretKey);
$data = $instance->zenlayerCallName();
var_dump($data);
 php
// test.php
enlayer\Instance;

$appId = 'YOUR-APP-ID';
$secretKey = 'YOUR-SECRET-KEY';
$instance = new Instance($appId, $secretKey);

$zoneId = 'PAR-A';
$data = $instance->describeZones([$zoneId]);
var_dump($data);

shell
 php .\test.php
array(1) {
  [0]=>
  object(BigbugGg\Zenlayer\Value\ZoneValue)#6 (2) {
    ["zoneId"]=>
    string(5) "PAR-A"
    ["zoneName"]=>
    string(5) "Paris"
  }
}