ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
>[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); } ```