PHP code example of vivlong / phalapi-aliyun-sms
1. Go to this page and download the library: Download vivlong/phalapi-aliyun-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/ */
vivlong / phalapi-aliyun-sms example snippets
/**
* 阿里云SMS相关配置
*/
'AliyunSms' => array(
'accessKeyId' => '<yourAccessKeyId>',
'accessKeySecret' => '<yourAccessKeySecret>',
'endpoint' => 'cn-hangzhou',
),
$di->aliyunSms = function() {
return new \PhalApi\AliyunSms\Lite();
};
\PhalApi\DI()->aliyunSms->sendSms('XXXX', 'XXXX', 'XXXX', array('code'=>'XXXX'));