public static function validateURL($string)
    {
        if (filter_var($string, FILTER_VALIDATE_URL)) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not a valid URL.',
                $string
            )
        );
    }
public static function validateURL($string)
    {
        if (filter_var($string, FILTER_VALIDATE_URL)) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not a valid URL.',
                $string
            )
        );
    }
public static function validateURL ( $ string ) { if ( filter_var ( $ string , FILTER_VALIDATE_URL ) ) { return ( string ) $ string ; } throw new InvalidArgumentException ( sprintf ( 'Provided string "%1$s" was not a valid URL.' , $ string ) ) ; }
Verify that a string is a URL or throw an Exception.

@since 0.1.0

@param string $string The string to validate.

@return string The validated string.
@throws InvalidArgumentException If the string is not a URL.
Verify that a string is a URL or throw an Exception .