PHP code example of steevenz / zenziva-sms
1. Go to this page and download the library: Download steevenz/zenziva-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/ */
steevenz / zenziva-sms example snippets
use Steevenz\ZenzivaSms;
/*
* --------------------------------------------------------------
* Inisiasi Class ZenzivaSms
*
* @param string Username
* @param string API Key
* --------------------------------------------------------------
*/
$zenzivaSms = new ZenzivaSms([
'userkey' => 'USERKEY_ANDA',
'passkey' => 'PASSKEY_ANDA'
]);
/*
* --------------------------------------------------------------
* Melakukan send sms
*
* @param string Phone Number
* @param string Text
*
* @return object|bool
* --------------------------------------------------------------
*/
// send message
$result = $zenzivaSms->send('082123456789','Testing Zenziva SMS API');
// send one time password (OTP)
$result = $zenzivaSms->sendOtp('082123456789','KODE123');