PHP code example of stonelyht / sdk

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

    

stonelyht / sdk example snippets




Stonely\Sdk\StonelyClient;

//初始化client,apikey作为所有请求的默认值

$clnt = StonelyClient::create('xxxxxxxxxxxxx');//apikey请到豪霆云官网申请(http://www.haotingyun.com)

$param = [
    StonelyClient::MOBILE => 'xxxxxxxxx',//接收信息的手机号
    StonelyClient::TEXT => "【豪霆云】你的验证码是1234,请注意查收!!"
];

$r = $clnt->sms()->single_send($param);

if($r->isSucc()){
    echo "<pre>";
    var_dump($r->data());
}else{
   
}