多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>[danger] 阿里大鱼短信验证 #### [https://packagist.org/packages/flc/dysms](https://packagist.org/packages/flc/dysms) ``` composer require flc/dysms ``` ```php use Flc\Dysms\Client; use Flc\Dysms\Request\SendSms; ``` ``` public function sendSms() { $config = [ 'accessKeyId' => 'LTAI4FxkezJcQyzMnixxxx', 'accessKeySecret' => 'ezh3hfslUO1By3lXJrel3lLxxxx', ]; $client = new Client($config); $sendSms = new SendSms; // 接受验证码的手机号 $sendSms->setPhoneNumbers('150xxxx'); // 签名 $sendSms->setSignName('it社区'); // 模板码 $sendSms->setTemplateCode('SMS_178456xxx'); // 模板变量 $sendSms->setTemplateParam(['code' => rand(100000, 999999)]); $sendSms->setOutId('demo'); // 执行发送验证码 $result = $client->execute($sendSms); // 打印结果 print_r($result); } ```