Created
June 11, 2015 18:18
-
-
Save metaist/8cff2245c2d0841e8d33 to your computer and use it in GitHub Desktop.
Better TwiML Echo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/xml'); | |
$result = $_GET['Twiml']; | |
foreach($_REQUEST as $k => $v) { | |
if ($k === 'Twiml') { continue; } // avoid infinite loop | |
$result = str_replace('${' . $k . '}', $v, $result); | |
}//end for: replaced all the tokens | |
echo $result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment