PHP code example of leolei / alisms
1. Go to this page and download the library: Download leolei/alisms 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/ */
leolei / alisms example snippets
return [
'alidayu' =>[
'app_key'=>'',
'app_secret'=>'',
'signature'=>'',
]
];
namespace app\common\service;
use leolei\Alisms\SmsGateWay;
class Sms {
public function send_code($mobile) {
$code = mt_rand(1000, 9999);
$AliSMS = new SmsGateWay();
$AliSMS->send($mobile, ['code'=>$code], 'SMS_10210103');
}
}