PHP code example of wulove52 / hello-word

1. Go to this page and download the library: Download wulove52/hello-word library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wulove52 / hello-word example snippets


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();
}