PHP code example of postoor / kotsms

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

    

postoor / kotsms example snippets




use postoor\KOTSms\Sms;

$sms = new Sms('username', 'password');

$options = ['Ftcode' => 'Sms'.rand(0, 10000)];
$messages = [];

$kmsGID = $sms->send('<phone number>', '我是中文', $options, $messages);

if ($kmsGID < 0) {
    var_dump($messages);
}

echo $kmsGID;

use postoor\KOTSms\Sms;

$sms = new Sms('username', 'password');
$point = $sms->getPoint();

echo $point;


use postoor\KOTSms\Sms;

$sms = new Sms('username', 'password');
$status = $sms->getSMSStatus(198987);

echo $status;