PHP code example of mlw / sms

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

    

mlw / sms example snippets


use MlwSms\Config\Config;
use MlwSms\Helpers\Request;
use MlwSms\MlwSmsClient;
use MlwSms\Service\Application;

// 创建配置实例
$config = new Config('your_access_key', 'your_secret_key');
// 创建客户端实例
$client = new MlwSmsClient($config);
// 获取应用服务
$app = new Application($client);

$verifyCodeService = $app->getVerifyCodeService();
$response = $verifyCodeService->send('18912345678', '1234##5', '【测试短信】', '178855');
print_r($response);