azishapidin

Zenziva Example

Oct 28th, 2017
5,530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. // Nomor Tujuan dan Isi SMS
  4. $sms = [
  5.     'nohp' => '081111111111',
  6.     'pesan' => 'Assalamualaikum'
  7. ];
  8.  
  9. // Prepare dan Konfigurasi
  10. $baseUrl = 'https://reguler.zenziva.net/apps/smsapi.php';
  11. $config = [
  12.     'userkey' => 'azishapidin.com',
  13.     'passkey' => '4215'
  14. ];
  15. $params = array_merge($config, $sms);
  16. $uri = $baseUrl . '?' . http_build_query($params);
  17.  
  18. // Kirim HTTP GET
  19. $curl = curl_init();
  20. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  21. curl_setopt($curl, CURLOPT_URL, $uri);
  22. $result = curl_exec($curl);
  23.  
  24. // Tampilkan Hasil/Response dari Zenziva
  25. header('Content-type: application/xml');
  26. echo $result;
Advertisement
Add Comment
Please, Sign In to add comment