View difference between Paste ID: E8N22Eac and H3uwz6Z7
SHOW: | | - or go back to the newest paste.
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("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
}