8
validatehostname
validate_host_name
SYNOPSIS
validate_host_name($host)
DESCRIPTION
validate_host_name
returns true
if $host
is a valid host name, false
otherwise.
CODE
- function validate_host_name($host) {
- return preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host);
- }
Comments