Skip to content

Instantly share code, notes, and snippets.

@JamesChevalier
Created January 14, 2012 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesChevalier/1612186 to your computer and use it in GitHub Desktop.
Save JamesChevalier/1612186 to your computer and use it in GitHub Desktop.
Reformat phone number so Twilio speaks it properly
<?php
$CallFrom = $_REQUEST['From']; // Take the phone number that is calling this app
$CallFrom = substr($CallFrom, 2); // Take the country code (+1, for example) off the front of the number
$CallFrom = chunk_split($CallFrom,1,","); // Insert a comma between each digit
echo $CallFrom;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment