src/Utilities/Regex.php
public static function isValidUrl($url, $requireProtocol = false)
    {
        /*
         * Not a string?
         * Nothing to do
         */
        if (!is_string($url)) {
            return false;
        }

        $pattern = self::getUrlPattern($requireProtocol);

        return (bool)preg_match($pattern, $url);
    }
public static function isValidUrl($url, $requireProtocol = false)
    {
        /*
         * Not a string?
         * Nothing to do
         */
        if (!is_string($url)) {
            return false;
        }

        $pattern = self::getUrlPattern($requireProtocol);

        return (bool)preg_match($pattern, $url);
    }
public static function isValidUrl ( $ url , $ requireProtocol = false ) { /*
         * Not a string?
         * Nothing to do
         */ if ( ! is_string ( $ url ) ) { return false ; } $ pattern = self :: getUrlPattern ( $ requireProtocol ) ; return ( bool ) preg_match ( $ pattern , $ url ) ; }
Returns information if given url address is valid

@param string $url             The url to validate / verify
@param bool   $requireProtocol (optional) If is set to true, the protocol is required to be passed in the url.
Otherwise - not.
@return bool
Returns information if given url address is valid