PHP code example of netgsm / otp
1. Go to this page and download the library: Download netgsm/otp 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/ */
netgsm / otp example snippets
use Netgsm\Otp\otp;
$data=array('message'=>'test mesajı5','no'=>'553XXXXXXX','header'=>'MESAJ_BASLIGINIZ');
//header: isteğe bağlı olarak farklı header bilginizi girebilirsiniz. Default olarak .env dosyası içerisinde belirtmiş olduğunuz header baz alınır.
$islem=new otp;
$sonuc=$islem->otp($data);
dd($sonuc);
Array
(
[durum] => Gönderim başarılı.
[jobid] => 1310546758
)
Array
(
[durum] => Gönderici adınızı kontrol ediniz.
[code] => 41
)