src/util/Validator.php
public static function isPhoneNumber($value) {
        if (!is_string($value)) return false;

        // handle empty value
        $value = trim($value);
        if (!strlen($value)) return false;

        // remove spaces
        $value = str_replace(' ', '', $value);

        // match numbers from BE, ES, BG, CH, A, UK, DE
        return (bool) preg_match('/^(00|\+)(32|34|359|41|43|44|49)-?[1-9](-?[0-9]){2,}$/', $value);

        // TODO: implement via https://github.com/giggsey/libphonenumber-for-php
    }
public static function isPhoneNumber($value) {
        if (!is_string($value)) return false;

        // handle empty value
        $value = trim($value);
        if (!strlen($value)) return false;

        // remove spaces
        $value = str_replace(' ', '', $value);

        // match numbers from BE, ES, BG, CH, A, UK, DE
        return (bool) preg_match('/^(00|\+)(32|34|359|41|43|44|49)-?[1-9](-?[0-9]){2,}$/', $value);

        // TODO: implement via https://github.com/giggsey/libphonenumber-for-php
    }
public static function isPhoneNumber ( $ value ) { if ( ! is_string ( $ value ) ) return false ; // handle empty value $ value = trim ( $ value ) ; if ( ! strlen ( $ value ) ) return false ; // remove spaces $ value = str_replace ( ' ' , '' , $ value ) ; // match numbers from BE, ES, BG, CH, A, UK, DE return ( bool ) preg_match ( '/^(00|\+)(32|34|359|41|43|44|49)-?[1-9](-?[0-9]){2,}$/' , $ value ) ; // TODO: implement via https://github.com/giggsey/libphonenumber-for-php }
Whether the passed string represents a valid phone number.

@param  string $value

@return bool
Whether the passed string represents a valid phone number .