Server
Table of Contents
Methods
| isDomain() | Determines whether the given domain is a valid domain name. |
| isIp() | Determines whether the given IP is a valid IP address |
| isUrl() | Determines whether the given URL is valid required |
Methods
isDomain()
Determines whether the given domain is a valid domain name.
public
isDomain(string $domain) : bool
NOTE: This does not check IDN/punycode/UTF-8 domains
Parameters
- $domain : string
-
The domain or subdomain to check (e.g. "domain.com", "sub.domain.com")
Return values
bool —True if the $domain is valid, false otherwise
isIp()
Determines whether the given IP is a valid IP address
public
isIp(string $ip) : bool
Parameters
- $ip : string
-
The IP address to validate
Return values
bool —True if the IP address is valid, false otherwise
isUrl()
Determines whether the given URL is valid required
public
isUrl(string $url) : bool
Parameters
- $url : string
-
The URL to validate (protocol not required, e.g. "http://")
Return values
bool —True if the URL is valid, false otherwise