twilio twiml和url编码/解码

时间:2015-09-22 18:12:47

标签: php twiml twilio-php

我正在发送此网址编码消息: http://anydomain.com/message.php?Message=This+is+a+test+message

到这个网址: http://anydomain.com/message.php

我无法弄清楚如何解码并在$ response->中获取“这是测试消息”。说()下面。 这是代码..

<?php

require_once(‘Services/Twilio.php’);

$response = new Services_Twilio_Twiml();

$response->pause(array("length" => 1));
$response->say(*how do i put the url encoded "This is a test message" message here??*, array("voice" => alice));
$response->pause(array("length" => 1));    
$response->say('End of message', array("voice" => alice));

print $response; 

其余的twiml工作......新的,所以任何帮助将非常感激。 谢谢 - 吉姆

1 个答案:

答案 0 :(得分:1)

你应该可以从$ _GET变量读取它,简单地这样做:

$response->say($_GET['Message'])

如果您在网址中传递了消息,那么$ _GET ['消息']将包含“这是测试消息”

相关问题