Skip to content

Instantly share code, notes, and snippets.

@caseysoftware
Created February 25, 2013 18:43
Show Gist options
  • Select an option

  • Save caseysoftware/5032171 to your computer and use it in GitHub Desktop.

Select an option

Save caseysoftware/5032171 to your computer and use it in GitHub Desktop.
<?php
include 'functions.php';
/**
* Now we'll combine Revision 3 with an interface to put some fine-grained
* control of the white and blacklists via SMS.
*/
$from = preg_replace("/[^0-9]/", "", $_POST['From']);
$body = preg_replace("/[^a-z0-9\ ]/", "", trim(strtolower($_POST['Body'])));
$message = process_command($body);
$response = new Services_Twilio_Twiml();
if ($toPhone == $from) {
$response->sms($message);
}
print $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment