Skip to content

Instantly share code, notes, and snippets.

@TMcManus
TMcManus / README.txt
Created March 8, 2012 01:18
Simple Twilio Conditional Logic
---- Setting up this script ----
1) Upload these files to a location that is publicly accessible on the internet.
2) Enter the URL of the file named "index.xml" into the Voice Request URL of the number you want to setup.
@TMcManus
TMcManus / uk_area_codes_list.php
Created February 9, 2012 16:21
List Twilio UK Area Codes
<?php
/**
* This script requires a Twilio Account and the Twilio PHP Helper Library,
* which can be found at http://www.twilio.com/docs/libraries
*/
// Require Twilio Helper Library
require('Services/Twilio.php');
@TMcManus
TMcManus / gist:1711143
Created January 31, 2012 15:42
Number Formatting Functions
<?php
/**
* This function will take a number in a variety of formats and reformat
* the number to be in E.164 format. Currently this is really, really ugly,
* but it works. substr() based function might also work. Currently US only.
*/
function normalizeNumber($number) {
$number = trim($number);
$number = preg_replace("/[^A-Za-z0-9]/", '', $number);