Please I need help to validate phone numbers in various formats
Valid formats:
+111 1 11111111
+11 1111111
1111111
(+111) (11) 1111111
Etc, the format is:
- You can take a "+" sign only at the beginning and once. Can lead an
- open and closed parenthesis only the beginning. You can not have more
- than 15 numbers in total. Can not be less than 8 numbers in total.
Have This:
if(strlen($buff) < 8)
return false;
$buff = trim(preg_replace('/\s+/', ' ', $buff));
if(preg_match('/^\(\d\) \d \d$/', $buff))
return $buff;
return false;
Thanks.