userinfo = null; $uri->host = null; $uri->port = null; // Delete all non-numeric characters, commas, and non-x characters // from phone number, EXCEPT for a leading plus sign. $uri->path = preg_replace('/(?!^\+)[^\dx,]/', '', // Normalize e(x)tension to lower-case str_replace('X', 'x', rawurldecode($uri->path))); return true; } } // vim: et sw=4 sts=4