承接 suhaoxiang/aliyun-dysms-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

suhaoxiang/aliyun-dysms-php-sdk

Composer 安装命令:

composer require suhaoxiang/aliyun-dysms-php-sdk

包简介

Aliyun SMS SDK for PHP

README 文档

README

安装方法

composer install suhaoxiang/aliyun-dysms-php-sdk

使用方法

	use Aliyun\Core\Config as AliyunConfig;
	use Aliyun\Core\Profile\DefaultProfile;
	use Aliyun\Core\DefaultAcsClient;
	use Aliyun\Api\Sms\Request\V20170525\SendSmsRequest;
	use Aliyun\Api\Sms\Request\V20170525\QuerySendDetailsRequest;

	$mobile='xxxxxx';	//电话号码

	$appKey = '';		//app key
	$appSecret = '';	//app secret
	$signName  = '';	//前面
	$template_code = '';//模板名称
	$json_string_param = json_encode(Array(
	    "code"=>rand(100000,999999)
	));

	AliyunConfig::load();
	$profile = DefaultProfile::getProfile("cn-hangzhou", $appKey, $appSecret);
	DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
	$acsClient = new DefaultAcsClient($profile);
	$request = new SendSmsRequest();
	$request->setPhoneNumbers($mobile);
	$request->setSignName($signName);
	$request->setTemplateCode($template_code);
	if(!empty($json_string_param)) {
	    $request->setTemplateParam($json_string_param);
	}

	$acsResponse =  $acsClient->getAcsResponse($request);

	if($acsResponse && strtolower($acsResponse->Code) == 'ok')
	{
	    return ['code'=>1,"msg"=>"发送短信验证码成功"];
	}
	return ['code'=>0,"msg"=>"发送短信验证码失败"];

统计信息

  • 总下载量: 269
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固