PHP code example of anerg2046 / alidayu

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

    

anerg2046 / alidayu example snippets




namespace app\common\service;

use anerg\Alidayu\SmsGateWay;

class Sms {

    public function send_code($mobile) {
        $code = mt_rand(1000, 9999);
        $AliSMS = new SmsGateWay();
        $AliSMS->send($mobile, ['code'=>$code], 'SMS_10210103');
    }

}