<?php
class FreeContentSmsSender
{
private static $_instance;
var $ch = NULL;
var $uri = "http://xx";
var $signature = "【xx】";
var $pid = "xx";
var $time = "xx";
public static function getInstance(){
if(!(self::$_instance instanceof self)){
self::$_instance = new self;
self::$_instance->ch = curl_init();
}
return self::$_instance;
}
public function send($message, $mobile)
{
$data = "account=xx&password=xx&content={$message}{$this->signature}&mobile={$mobile}&time={$this->time}&pid={$this->pid}";
curl_setopt ( $this->ch, CURLOPT_URL, $this->uri );
curl_setopt ( $this->ch, CURLOPT_POST, 1 );
curl_setopt ( $this->ch, CURLOPT_HEADER, 0 );
curl_setopt ( $this->ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $this->ch, CURLOPT_POSTFIELDS, $data );
$response = curl_exec ( $this->ch );
}
};
$sender = FreeContentSmsSender::getInstance();
$sender->send("儿童节快乐。", "13912345678");
?>
以上技术应用于最优质的水果的鲜果篮