PHP code example of yonghua4413 / ali-sms
1. Go to this page and download the library: Download yonghua4413/ali-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/ */
yonghua4413 / ali-sms example snippets
//引入
use YYHSms\SendSms;
$app = [
'accessKeyId' => '',
'accessKeySecret' => ''
];
$parems = [
'PhoneNumbers' => '手机号,多个手机号请用“,”隔开',
'SignName' => '短信签名',
'TemplateCode' => '模板编号',
'TemplateParam' => [
//模板变量名 => 模板变量值
'token' => $token
]
];
$sms = new SendSms($app, $parems);
$info = (array) $sms -> send();
set_time_limit(0);