What I want
I want to get from a URL the domain part so from http://example.com/ -> example.com>
URL
domain
http://example.com/
example.com>
This is like the regex from theraccoonbear but with support for HTTPS domains.
if (preg_match('/https?:\/\/([^\/]+)\//i', $target_string, $matches)) { $domain = $matches[1]; }