PHP code example of vccmas / tencentcloud-sdk-php-intl-en

1. Go to this page and download the library: Download vccmas/tencentcloud-sdk-php-intl-en 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/ */

    

vccmas / tencentcloud-sdk-php-intl-en example snippets



port the client of the corresponding product module
use TencentCloud\Cvm\V20170312\CvmClient;
// Import the `Request` class corresponding to the request API
use TencentCloud\Cvm\V20170312\Models\DescribeInstancesRequest;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Common\Credential;
try {
    // Instantiate a certificate object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as input parameters
    $cred = new Credential("secretId", "secretKey");

    // # Instantiate the client object of the requested product (with CVM as an example)
    $client = new CvmClient($cred, "ap-guangzhou");

    // Instantiate a request object
    $req = new DescribeInstancesRequest();

    // Call the API you want to access through the client object. You need to pass in the request object
    $resp = $client->DescribeInstances($req);

    print_r($resp->toJsonString());
}
catch(TencentCloudSDKException $e) {
    echo $e;
}