Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created April 29, 2016 20:32
Show Gist options
  • Save RobSpectre/951d9002b7f2ada8def9c3b1b82abf83 to your computer and use it in GitHub Desktop.
Save RobSpectre/951d9002b7f2ada8def9c3b1b82abf83 to your computer and use it in GitHub Desktop.
Conditional logic in a Twilio SMS reply.
<?php
header('Content-type: text/xml');
$body = $_REQUEST['Body'];
if ($body == "Yes") {
$response = "You said yes.";
} else {
$response = "You didn't say yes.";
}
?>
<Response>
<Message><?php echo $response; ?></Message>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment