Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Sms
- {
- function send($destination, $content){
- $ci =& get_instance();
- $userKey = $ci->config->item('sms_user_key');
- $passKey = $ci->config->item('sms_pass_key');
- $target="http://example.com?user=$userKey&pass=$passKey&senderid=&nomor=$destination&pesan=".urlencode($content);
- $xmlResponse = @simplexml_load_file($target);
- if( is_array($xmlResponse)||is_object($xmlResponse)){
- $jsonResponse = json_encode($xmlResponse);
- $response = json_decode($jsonResponse);
- return $response->message;
- }
- else{
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement