- PHP >= 5.4
- guzzlehttp/guzzle >=5.3
composer require wulove52/hello-word:dev-master
use Wulove52\HelloWord\Alidayu;
Alidayu::setConfig([
'appKey' => '23356838',
'appSecret' => '254fee5fbabe2e01be04581d855c9af3',
// 使用HTTPs
'secure' => false,
]);
use Wulove52\HelloWord\Alidayu;
// 发送短信通知
$sms = Alidayu::sms('17191195520', 'SMS_100875117', '潘晓亮', ['number' => '1234']);
// 发送请求并返回响应
$response = $sms->send();
if ($response->success()) {
// 接口返回成功
print_r($response->getData());
} else {
// 接口返回错误
echo $response->getError();
}