本文整理汇总了PHP中SMS::changeStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP SMS::changeStatus方法的具体用法?PHP SMS::changeStatus怎么用?PHP SMS::changeStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMS
的用法示例。
在下文中一共展示了SMS::changeStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendSMS
function sendSMS($msgdata)
{
$reg_id = parent::registerSMS($msgdata);
$data = array("key" => $this->api_key, "countrycode" => "BD", "numbers" => $msgdata['to'], "message" => urlencode($msgdata['msg']));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://bulksms.synergyinterface.com/sms_db/bulk_send_api.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
$response = curl_exec($ch);
curl_close($ch);
if ($this->debug) {
echo 'DEBUG:[' . $response . ']';
}
$result = json_decode($response);
if ($result->return == 'true') {
$status = 1;
} else {
$status = 0;
}
parent::changeStatus($reg_id, $status);
return $status;
}
示例2: sendSMS
function sendSMS($msgdata)
{
$reg_id = parent::registerSMS($msgdata);
$api = 'http://portals.bd.airtel.com/msdpapi?REQUESTTYPE=SMSSubmitReq&USERNAME=' . $this->api_key . '&PASSWORD=' . $this->api_secret . '&MOBILENO=';
$api .= $msgdata['to'] . '&MESSAGE=' . urlencode($msgdata['msg']);
$api .= '&TYPE=0&ORIGIN_ADDR=' . urlencode(isset($msgdata['from']) ? $msgdata['from'] : $this->from);
$response = file_get_contents($api);
if ($this->debug) {
echo 'DEBUG:[' . $response . ']';
}
if (preg_match('/Accepted/', $response)) {
$status = 1;
} else {
$status = 0;
}
parent::changeStatus($reg_id, $status);
return $status;
}