Twilio twiml和url编码/解码


twilio twiml and url encode/decode

我正在发送这个url编码的消息:http://anydomain.com/message.php?Message=This +是+ +测试+消息

到这个url:http://anydomain.com/message.php

我不知道如何解码并在下面的$response-> say()中获得"这是一个测试消息"。下面是代码。

<?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工作…新的,所以任何帮助将非常感激。谢谢——吉姆

您应该能够从$_GET变量中读取它,只需这样做:

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

其中Message是你在URL中传递的内容,所以$_GET['Message']将包含" This is a test Message "