This function determines whether the provided value is of
type str and contains a URL. A valid URL must start with either http:///
, https://
or ftp://
.
This function does not generate a change.
is_url(value)
Argument | Type | Description |
---|---|---|
value | any (required) | The value to be tested. |
Returns true
if the given value is of type str
and contains a URL, else false
.
This code shows some return values for is_url():
[
is_url( 'www.google.com' ),
is_url( 'https://thingsdb.io' ),
is_url( 'http://127.0.0.1/?a=1' ),
];
Return value in JSON format
[
false,
true,
true
]