method

extract_domain

Importance_1
extract_domain(host, tld_length) public

Returns the domain part of a host given the domain level.

# Top-level domain example
extract_domain('www.example.com', 1) # => "example.com"
# Second-level domain example
extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk"
Show source
Register or log in to add new notes.