Joke Collection Website - Blessing messages - How does php call api interface, mainly php calls Unicom and mobile api to send short messages?

How does php call api interface, mainly php calls Unicom and mobile api to send short messages?

You can't adjust your exercise. Unicom api, if you want to send SMS, you can go to the SMS interface, usually go to the operator to buy it, and then they provide api. Then use php to dock, which is very simple. For example, the following is an api issued by a company:

$ this-& gt; Content = "send content";

$ this-& gt; Name = "SMS account ";

$ this-& gt; Pwd= "SMS password";

$ this-& gt; Mobile = "sent mobile phone number";

$argv = array(

name ' = & gt$ this-& gt; Name,//required parameter. User account

pwd ' = & gt$ this-& gt; Pwd,//required parameters. (web platform: interface password in basic information)

content ' = & gt$ this-& gt; Content,//Required parameter. Send content (1-500 Chinese characters) UTF-8 encoding.

Move' =>$ this-& gt;; Mobile,//required parameters. Mobile phone numbers, many of which are separated by English commas.

stime ' = >; ,//Optional parameter. Send time: send when filling in, and send when not filling in.

Symbol' =>$ this-& gt;; Sign,//Required parameter. User signature.

type ' = & gt$ this-& gt; Type,//required parameter. Fixed value pt

extno ' = & gt$ this-& gt; Extno // Optional parameters, spreading codes, user-defined spreading codes, numbers only.

);

//Construct the string to be published.

foreach($ argv as $ key = & gt; $value) {

If ($flag! =0) {

$params。 = " & amp;

$ flag = 1;

}

$params。 = $key。 "=";

$params。 = urlencode($ value);

$ flag = 1;

}

$url = "?" . $ params// submitted url

$ result URL = file _ get _ contents($ URL); //Get the sending status