PHP code example of yunpian / yunpian-php-sdk
1. Go to this page and download the library: Download yunpian/yunpian-php-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/ */
yunpian / yunpian-php-sdk example snippets
use \Yunpian\Sdk\YunpianClient;
//初始化client,apikey作为所有请求的默认值
$clnt = YunpianClient::create($apikey);
$param = [YunpianClient::MOBILE => '18616020000',YunpianClient::TEXT => '【云片网】您的验证码是1234'];
$r = $clnt->sms()->single_send($param);
//var_dump($r);
if($r->isSucc()){
//$r->data()
}
//账户$clnt->user() 签名$clnt->sign() 模版$clnt->tpl() 短信$clnt->sms() 语音$clnt->voice() 流量$clnt->flow() 视频短信$clnt->vsms()
json
" "yunpian/yunpian-php-sdk" : "~1.0"
}