Code: Select all
//Caller ID numbers can come in in all sorts of forms:
// 2505551234
// 12505551234
// +12505551234
// (250) 555-1234
//Parse out just the digits, and use only the last 10 digits.
//Currently this will not support international numbers
static function parseCallerID( $number ) {
$validator = new Validator();
$retval = substr( $validator->stripNonNumeric( $number ), -10, 10 );
return $retval;
}
http://stackoverflow.com/questions/7235 ... n-sql-varc
http://www.itu.int/ITU-T/recommendation ... ?rec=E.164
this worked for me:
Code: Select all
static function parseCallerID( $number ) {
$validator = new Validator();
$retval = substr( $validator->stripNonNumeric( $number ), -15);
return $retval;
}