PHP code example of aping / palisms

1. Go to this page and download the library: Download aping/palisms 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/ */

    

aping / palisms example snippets


$config = [
    'AccessKeyId'       => 'AccessKeyId',
    'AccessKeySecret'   => 'AccessKeySecret',
];

\Palisms\Fast::smsSend($data, function (SendRequest $request) {
    //请求
    $request->setRecNum(['13000000000']);
    $request->setSmsFreeSignName('易开发');
    $request->setSmsTemplateCode('SMS_71365710');
    $request->setSmsParam(['code'=>'654321']);

}, function (SendRequest $request, Response $response) {
    // 成功后才会回调

    // 请求 NumSendRequest
    // print_r($request);
    
    // 响应 NumSendResponse
    // print_r($response);
    
    // 直接转json方便保存请求和响应的数据
    // echo $request;
    // echo $response;
    
    // 相关方法
    // var_dump($response->isSuccess());
});
bash
php composer.phar