php 移动app服务器地址,php – 在我的智能手机上从网络服务器发送消息到移动聊天应用程序(如WhatsApp,Viber或Kik)?...

有许多Web服务允许您发送和接收SMS /通知. PHP本身并不支持它.您可以使用像Twilio这样的服务来执行此操作.您可以将消息发送到您自己的智能手机,甚至朋友的消息.

require "Services/Twilio.php";

// Step 2: set our AccountSid and AuthToken from www.twilio.com/user/account

$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";

// Step 3: instantiate a new Twilio Rest Client

$client = new Services_Twilio($AccountSid, $AuthToken);

// Step 4: make an array of people we know, to send them a message.

// Feel free to change/add your own phone number and name here.

$people = array(

"+14158675309" => "Curious George",

"+14158675310" => "Boots",

"+14158675311" => "Virgil",

);

// Step 5: Loop over all our friends. $number is a phone number above, and

// $name is the name next to it

foreach ($people as $number => $name) {

$sms = $client->account->sms_messages->create(

// Step 6: Change the 'From' number below to be a valid Twilio number

// that you've purchased, or the (deprecated) Sandbox number

"YYY-YYY-YYYY",

// the number we are sending to - Any phone number

$number,

// the sms body

"Hey $name, Monkey Party at 6PM. Bring Bananas!"

);

// Display a confirmation message on the screen

echo "Sent message to $name";

}

请参阅文档here.

希望这可以帮助!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值