PHP code example of xzncit / sms

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

    

xzncit / sms example snippets




use xzncit\SMS;

try {
    // SMS
    $app = SMS::create("tencent",[ ... ]);
    
    // 上传资源
    $response = $app->send([]);
    
    // 返回信息
    var_dump($response);
}catch (\Exception $ex){
    echo("error: ".$ex->getMessage());
}