Advertisement
GWibisono

Untitled

Feb 13th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Sms
  2. {
  3.     function send($destination, $content){
  4.         $ci =& get_instance();
  5.         $userKey = $ci->config->item('sms_user_key');
  6.         $passKey = $ci->config->item('sms_pass_key');
  7.           $target="http://example.com?user=$userKey&pass=$passKey&senderid=&nomor=$destination&pesan=".urlencode($content);
  8.         $xmlResponse = @simplexml_load_file($target);
  9.         if( is_array($xmlResponse)||is_object($xmlResponse)){
  10.         $jsonResponse = json_encode($xmlResponse);
  11.         $response = json_decode($jsonResponse);
  12.  
  13.         return $response->message;
  14.         }
  15.         else{
  16.             return false;
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement