相當簡單 這個接口調用就是封裝壹個curl請求的function (sendSMS),代碼示例網站上已經有了,使用時:加載這個function, 然後 調用方法sendSMS;
我把源碼給妳貼壹遍,這個裏面的賬號密碼是需要妳們自己去申請的;
<?$username?=?'test';?//用戶賬號
$password?=?'123456';?//密碼
$mobile?=?'13811299934,18610310066,15210954922';?//號手機碼
$content?=?'您的短信驗證碼是:ABCD';?//內容
//即時發送
$result?=?sendSMS($username,$password,$mobile,$content);
echo?$result;
function?sendSMS($username,$password,$mobile,$content)
{
$url?=?'');
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,?CURLOPT_POSTFIELDS,$post_fields);
$data?=?curl_exec($ch);
curl_close($ch);
$res?=?explode("\r\n\r\n",$data);
return?$res[2];?
}
>