PHP code example of ddphp / sms
1. Go to this page and download the library: Download ddphp/sms 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/ */
ddphp / sms example snippets
$smsSzrk = new \Sms\Szrk();
$smsSzrk->account($user, $password); // 账号设置 必须
$smsSzrk->sign($sign); // 短信内容签名设置 (发送短信时必须设置项)
$smsSzrk->encode($encode); // 短信字符集类型 默认:utf-8 可选
/* 发送短信 */
$smsSzrk->send($mobile, $content); // 实时发送
$smsSzrk->send($mobile, $content, $sendTime); // 定时发送
/* 获取短信剩余数量 */
$smsSzrk->selSum();