PHP code example of sy-records / easy-aliyun

1. Go to this page and download the library: Download sy-records/easy-aliyun 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/ */

    

sy-records / easy-aliyun example snippets


composer 

# 短信
$config = [
    'appId'  => '', // 阿里云 AccessKeyID
    'appKey' => '', // 阿里云 AccessKeySecret
    'tplId' => 'SMS_888888888', // 短信模板ID
    'signName' => '', // 短信签名
];
# Axnbind配置
$config = [
    'appId'  => '', // 阿里云 AccessKeyID
    'appKey' => '', // 阿里云 AccessKeySecret
    'poolKey' => '', // 号池Key
];


use SyRecords\Aliyun;

# $config 配置信息是数组
$aliyun = new Aliyun($config);

# 手机号;验证码;是否是营销短信(营销短信无需验证码)
$aliyun->sendSms($mobile, $code = '', $isMarketing = 0);
# AXN中的A号码;绑定关系过期时间;AXN中的默认的B号码;默认95接入号,目前支持2种号码类型
$aliyun->putAxnBind($phoneNoA, $time, $phoneNoB = '', $noType = 'NO_95');