PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php class RocketSms { private $login; private $pass; function __construct($login, $pass) { $this->login = $login; $this->pass = $pass; } public function sendRocketSMS($phone, $message) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://api.rocketsms.by/json/send'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "username=" . $this->login . "&password=" . $this->pass . "&phone=" . $phone . "&text=" . $message . "&priority=true"); $result = @json_decode(curl_exec($curl), true); return $result; } }
Show:  
Copy Clear