I go, disciple midnight Call let write a PHP SMS verification (and mass)

Source: Internet
Author: User
Tags php sms verification

Feel very puzzled ah,,. A few days almost all night, I thought I had an early night sleep, incredibly more than 2 to call to help ...

I remember some time ago, Bo friends asked similar questions ....

Name I will hide it, hehe,,

I found on the Internet a Web site to provide the corresponding interface, in fact, the site is arbitrary, this is the small meaning of Datong ...

I use SMS treasure, we like to use what casual, not to charge advertising fees ...

<?PHPHeader("Content-type:text/html;charset=utf-8");$arr=Array(    Array(' phome ' = ' 15666666666 ', ' name ' = ' Lisi ', ' code ' =Rand()),Array(' phome ' = ' 15888888888 ', ' name ' = ' Zhangfei ', ' code ' =Rand())); foreach($arr  as $k=$v){        //here, such as the storage of their own methods ....        $statusStr=Array(        "0" + "message sent successfully", "1" + "parameter not complete", "-2" + "server space is not supported, please confirm support curl or fsocket, contact your space provider to resolve or change the space!" "," "+" and "Password Error", "+" and "account does not exist", "all" and "balance Insufficient", "" "+" account Expired "," 43 "= > "IP Address Restrictions", "+" and "content contains sensitive words"        ); $smsapi= "http://api.smsbao.com/"; $username= ' kill lui gung dog '; $user= "Test";//SMS Platform Account        $pass=MD5("test888");//SMS Platform Password        $str= "Super Play Machine" How are you? You are a respected user. "$v[' name ']. "?? Your verification code is: ".$v[' Code ']; $content=$str;//SMS content to send        $phone=$v[' Phome '];//mobile phone number to send a text message        $sendurl=$smsapi." Sms?u= ".$user." &p= ".$pass." &m= ".$phone." &c= ".UrlEncode($content); $result=file_get_contents($sendurl) ; Echo $statusStr[$result]; }?>

This interface is more special to send the content to write a can, so I casually up a "super Play Machine" name ...

If it is a single-heads sent without entering the Foreach loop, to this step estimate all understand it?

I go, disciple midnight Call let write a PHP SMS verification (and mass)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.