本文整理汇总了PHP中SoapClient::send_sms方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::send_sms方法的具体用法?PHP SoapClient::send_sms怎么用?PHP SoapClient::send_sms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::send_sms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMessage
public static function sendMessage($phone, $message)
{
$client = new SoapClient('http://smsc.ru/sys/soap.php?wsdl');
$ret = $client->send_sms(array('login' => self::$login, 'psw' => self::$passwd, 'phones' => $phone, 'mes' => $message, 'id' => '', 'sender' => '', 'time' => 0));
if (isset($ret->sendresult->error)) {
return array(false, $ret->sendresult->error);
} else {
return array(true, $ret->sendresult->id);
}
}
示例2: send
public function send()
{
$client = new SoapClient(self::SMSC_URL);
$ret = $client->send_sms(["login" => self::SMSC_LOGIN, "psw" => self::SMSC_PASSWORD, "phones" => $this->number, "mes" => $this->text]);
if (isset($ret->sendresult->error)) {
$this->message = 'Ошибка. ' . $this->errors[$ret->sendresult->error];
return false;
} else {
$this->message = 'Смс отправлено';
return true;
}
}
示例3: SendSMS
public function SendSMS()
{
$receiver = array();
foreach ($this->to as $number) {
$receiver[] = "{$number}";
}
$client = new SoapClient($this->wsdl_link);
$result = $client->send_sms($this->username, $this->password, $this->from, implode($receiver, ","), $this->msg);
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
}
return $result;
}
示例4: SendSMS
public function SendSMS()
{
// Check credit for the gateway
if (!$this->GetCredit()) {
return;
}
/**
* Modify sender number
*
* @since 3.4
* @param string $this->from sender number.
*/
$this->from = apply_filters('wp_sms_from', $this->from);
/**
* Modify Receiver number
*
* @since 3.4
* @param array $this->to receiver number
*/
$this->to = apply_filters('wp_sms_to', $this->to);
/**
* Modify text message
*
* @since 3.4
* @param string $this->msg text message.
*/
$this->msg = apply_filters('wp_sms_msg', $this->msg);
$receiver = array();
foreach ($this->to as $number) {
$receiver[] = "{$number}";
}
$client = new SoapClient($this->wsdl_link);
$result = $client->send_sms($this->username, $this->password, $this->from, implode($receiver, ","), $this->msg);
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
/**
* Run hook after send sms.
*
* @since 2.4
* @param string $result result output.
*/
do_action('wp_sms_send', $result);
return $result;
}
}