PHP code example of strayjoke / dogsms

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

    

strayjoke / dogsms example snippets


$config =[
    // 默认发送配置
    'default' => [
        // 默认可用的发送网关
        'gateways' => [
            'alibabaCloud', 'tencentCloud',
        ],
    ],
    // 可用的网关配置
    'gateways' => [
        'tencentCloud' => [
            'secret_id' => 'AKIDTijUzFxxxxxxxxxxxxx', //密钥id
            'secret_key' => 'QcdXBXcT5xxxxxxxxxxxxx', //密钥
            'sign_name' => 'xxxx',               //短信签名
        ],
        'alibabaCloud' => [
            'access_key_id' => 'LTAIMjVxxxxxxxx',     //密钥id
            'access_key_secret' => 'NnE90xxxxxxxxx',   //密钥
            'sign_name' => 'xxxxx',     //短信签名
        ]
    ]
];