24 Star 46 Fork 21

cigery / alisms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

阿里大鱼(阿里大于)短信发送SDK(PHP简化版)

  • 整个SDK就1个核心类文件约100行代码,非常轻量精简
  • 兼容PHP5.2 - 7.0

使用示例

include 'alisms.php';

$key = ''; //App Key
$secret = ''; //App Secret

//实例化类:两个参数分别为申请通过后的 App Key 和 App Secret
$alisms = new alisms($key, $secret);

//短信签名: API请求参数sms_free_sign_name的值
$alisms->sms_sign('大鱼测试'); 

//短信模板变量: API请求参数sms_param的值, 官方示例值为json格式字符串,而这里只需数组格式即可,会自动转换为json
$alisms->sms_param(array('code' => '8888', 'product' => '测试'));

//短信模板ID:API请求参数sms_template_code的值(如:SMS_12185895)
$alisms->sms_template('SMS_12185895');

//短信接收号码: API请求参数rec_num的值
$alisms->sms_mobile('13900000000');

//发送短信: 返回boolean值 TRUE 为成功 FALSE 为失败或发生异常 
$res = $alisms->send();

//如发送失败,打印错误查看对应错误代码;
if(!$res) print_r($alisms->error);

具体api参数作用描述请自行参考官方API alibaba.aliqin.fc.sms.num.send (短信发送)中的说明

MIT License Copyright (c) 2020 cigery Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

阿里大鱼(阿里大于)短信发送SDK精简版(PHP5.2及以上) 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/cigery/alisms.git
git@gitee.com:cigery/alisms.git
cigery
alisms
alisms
master

搜索帮助