Yii-- smsto短信接口的函数
- public function smsto($telphone,$message)
- {
- //短信接口用户名 $uid,如果没有或不能发送请与客服联系
- $uid = 'zyd';
- //短信接口密码 $passwd
- $passwd = '123456';
-
- //发送到的目标手机号码 $telphone
- $telphone = $telphone;//此处改成自己的手机号
- //短信内容 $message
- $message = $message;
- $message1 =urlencode(mb_convert_encoding($message, 'utf-8', 'gb2312'));
- $gateway = "http://sms.zyd.com/msgsend.ashx?USERNAME={$uid}&PASSWORD={$passwd}&MOBILE={$telphone}&CONTENT={$message1}&SEQ=1000"; //接口,请自行修改
- $result = file_get_contents($gateway);
- return $result;
- }