PHP code example of dew-serverless / acs-sdk-php

1. Go to this page and download the library: Download dew-serverless/acs-sdk-php 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/ */

    

dew-serverless / acs-sdk-php example snippets


use Dew\Acs\Vpc\VpcClient;

$client = new VpcClient([
    'region' => 'cn-shenzhen',
    'credentials' => [
        'key' => '<YOUR_ACCESS_KEY_ID>',
        'secret' => '<YOUR_ACCESS_KEY_SECRET>',
    ],
]);

$result = $client->createVpc([
    'RegionId' => 'cn-shenzhen',
]);

echo $result['VpcId']; // retrieve the newly-created VPC ID.