$Api['base'] = 'https://api.iletimerkezi.com/v1/send-sms/get/';
$Api['user'] = 'Buraya İletimerkezi Username';
$Api['pass'] = 'Buraya İletimerkezi Password';
function createSMS($a, $b, $c){
global $Api;
$list = '';
foreach ($b as $r){
if ($r[0] === '0') $r = substr($r, 1); // Eğer İlk Karakter 0 İse Sil - 5XXXXXXXXX Şeklinde Olmalı.
$list .= $r.',';
}
$list = rtrim($list, ','); // En Sondaki Virgülü Sil - Çoklu SMS Gönderiminde Numaralar Virgül İle Sıralanır.
$output = $Api['base'].'?username='.$Api['user'].'&password='.$Api['pass'].'&text='.$a.'&receipents='.$list.'&sender='.$c;
return $output;
}
function cURL($URL){
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
$SMS = 'Merhaba. Bu Deneme Bir Mesaj.';
$Receipents = array(
'5000000000',
'5111111111',
'5222222222'
);
$Sender = 'Firma İsmi Buraya';
$Api['url'] = createSMS($SMS, $Receipents, $Sender);
$Api['return'] = cURL($Api['url']);
$xml = simplexml_load_string($Api['return']);
$json = json_encode($xml, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$code = $json->status->code;
$message = $json->status->message;
?>
SMS Api
Durum Kodu:
Durum Mesajı: