Exemplo n.º 1
0
 public function sendSms()
 {
     $param = $this->param($this->params);
     $time = date('YmdHis') . '001';
     $token = $this->token;
     $sign = strtolower(md5($this->sid . $time . $token));
     $postArgs = array('sid' => $this->sid, 'appId' => $this->appId, 'time' => $time, 'sign' => $sign, 'to' => $this->mobile, 'templateId' => $this->tmplId);
     $getUrl = http_build_query($postArgs);
     $url = 'http://www.ucpaas.com/maap/sms/code?' . $getUrl . '&param=' . $param;
     $response = HttpClient::get($url);
     if ($response['resp']['respCode'] == '000000') {
         return array('status' => 'success');
     } else {
         return array('status' => 'error');
     }
 }
Exemplo n.º 2
0
function getMobileArea($mobile)
{
    $url = 'http://apistore.baidu.com/microservice/mobilephone?tel=' . $mobile;
    $response = HttpClient::get($url);
    return $response['retData']['carrier'];
}