Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 向手机发送通知并从用户处获得反馈_Php_Sms Gateway - Fatal编程技术网

Php 向手机发送通知并从用户处获得反馈

Php 向手机发送通知并从用户处获得反馈,php,sms-gateway,Php,Sms Gateway,我正在做一个项目,有一个概念我不知道如何处理它。 我需要在用户的移动设备上向用户发送通知,以便理解,让我们举一个例子:- 就像我想问我的朋友他想不想去看电影一样。 我需要向他的移动设备发送通知,通知将 “你喜欢看电影吗?”:然后他会回答是或否,现在这个回答将存储到数据库中 这个通知可能是短信或其他东西,我不知道如何处理它,我是否需要使用短信服务或其他东西或一些技术。我在php网络技术领域工作 请分享你的想法 谢谢这可能是一个很好的解决方案 您可以使用该库与REST API交互,如下所示: <

我正在做一个项目,有一个概念我不知道如何处理它。 我需要在用户的移动设备上向用户发送通知,以便理解,让我们举一个例子:-

就像我想问我的朋友他想不想去看电影一样。 我需要向他的移动设备发送通知,通知将

“你喜欢看电影吗?”:然后他会回答是或否,现在这个回答将存储到数据库中

这个通知可能是短信或其他东西,我不知道如何处理它,我是否需要使用短信服务或其他东西或一些技术。我在php网络技术领域工作

请分享你的想法

谢谢

这可能是一个很好的解决方案

您可以使用该库与REST API交互,如下所示:

<?php

require "/path/to/twilio-php/Services/Twilio.php";

// set your AccountSid and AuthToken from www.twilio.com/user/account
$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";

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

$sms = $client->account->sms_messages->create(
    "YYY-YYY-YYYY", // From this number
    "XXX-XXX-XXXX", // To this number
    "Test message!"
);

// Display a confirmation message on the screen
echo "Sent message {$sms->sid}";

,谢谢你的留言!

祝你好运

为什么有人会这样做,而他们可以自己发送一条短信?这更多的是一个评论,而不是一个答案。如果您提供了一个如何使用该服务的示例,那就好了。“只是将一个人指向一个服务,这是一个注释。@JustinWood指向Twilio的PHP助手库,并发布了他们文档中的示例代码。老实说,OP可以通过一些快速的谷歌搜索找到所有这些,所以这个问题并不是很有价值,更不用说这个问题可能被认为是广泛的,因为有很多短信网关提供商,而“最好的一个”可能会成为一个主观或自以为是的答案
<?php

    // make an associative array of senders we know, indexed by phone number
    $people = array(
        "+14158675309"=>"Curious George",
        "+14158675310"=>"Boots",
        "+14158675311"=>"Virgil",
    );

    // if the sender is known, then greet them by name
    // otherwise, consider them just another monkey
    if(!$name = $people[$_REQUEST['From']]) {
        $name = "Monkey";
    }

    // now greet the sender
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Message><?php echo $name ?>, thanks for the message!</Message>
</Response>