src/PhoneNumberUtil.php
public static function isViablePhoneNumber($number)
    {
        if (static::$VALID_PHONE_NUMBER_PATTERN === null) {
            static::initValidPhoneNumberPatterns();
        }

        if (mb_strlen($number) < static::MIN_LENGTH_FOR_NSN) {
            return false;
        }

        $validPhoneNumberPattern = static::getValidPhoneNumberPattern();

        $m = preg_match($validPhoneNumberPattern, $number);
        return $m > 0;
    }
public static function isViablePhoneNumber($number)
    {
        if (static::$VALID_PHONE_NUMBER_PATTERN === null) {
            static::initValidPhoneNumberPatterns();
        }

        if (mb_strlen($number) < static::MIN_LENGTH_FOR_NSN) {
            return false;
        }

        $validPhoneNumberPattern = static::getValidPhoneNumberPattern();

        $m = preg_match($validPhoneNumberPattern, $number);
        return $m > 0;
    }
public static function isViablePhoneNumber ( $ number ) { if ( static :: $ VALID_PHONE_NUMBER_PATTERN === null ) { static :: initValidPhoneNumberPatterns ( ) ; } if ( mb_strlen ( $ number ) < static :: MIN_LENGTH_FOR_NSN ) { return false ; } $ validPhoneNumberPattern = static :: getValidPhoneNumberPattern ( ) ; $ m = preg_match ( $ validPhoneNumberPattern , $ number ) ; return $ m > 0 ; }
Checks to see if the string of characters could possibly be a phone number at all. At the
moment, checks to see that the string begins with at least 2 digits, ignoring any punctuation
commonly found in phone numbers.
This method does not require the number to be normalized in advance - but does assume that
leading non-number symbols have been removed, such as by the method extractPossibleNumber.

@param string $number to be checked for viability as a phone number
@return boolean true if the number could be a phone number of some sort, otherwise false
Checks to see if the string of characters could possibly be a phone number at all . At the moment checks to see that the string begins with at least 2 digits ignoring any punctuation commonly found in phone numbers . This method does not require the number to be normalized in advance - but does assume that leading non - number symbols have been removed such as by the method extractPossibleNumber .