0
votes

I am using the Twilio PHP Helper Library. When using Twilio/Twiml Class it appears that when adding an Attribute, Ampersands ( "&") are escaped. This appears to be an underlying code issue that uses SimpleXML libraries. However that said, I am trying to append variables to a URL string to be used by the CallBack. and the '&" are needed.

$response = new Twilio\Twiml();
$action = "test.php?name=value&name2=value2";
$response->record( 
array( 
 'action' => $action ,  
 'maxLength' => '120' 
));

The & (Ampersand) is replaced with &

1
Has this caused a problem when used with Twilio? While the ampersands are encoded for the XML, when they are decoded they should just be an ampersand. - philnash
I will try again and report back - Brian

1 Answers

0
votes

use & instated off &

 $response = new Twilio\Twiml();
 $action = "test.php?name=value&name2=value2";
 $response->record( 
 array( 
 'action' => $action ,  
 'maxLength' => '120' 
 ));