PHP code example of koala-gc / sms

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

    

koala-gc / sms example snippets


$config=[
            'default'=>[
                'gateways' => [
                    'huyi'
                ],
            ],
            'log'=>storage_path('smslog'),
            'gateways'=>[
                'huyi'=>[
                    'account'=>'***',
                    'password'=>'***'
                ],
                'dianxin'=>[
                    'access_token'=>'***',
                    'token_secret'=>'***',
                ]
            ]
        ];

//不使用短信模板
    $res = $sms->send('$mobile','您的验证码是:123456 。 请不要把验证码泄露给其他人。',['huyi']);
//使用短信模板
    $res = $sms->send('$mobile',['content'=>'您的验证码是:123456 。 请不要把验证码泄露给其他人。','template'=>'123'],['huyi']);