I have a static domain of dev.example.com with wildcard subdomains like so *.dev.example.com.
dev.example.com
*.dev.example.com
I need to detect the name of the current wild
$domain = 'sub.dev.example.com'; $tmp = explode('.', $domain); $subdomain = current($tmp); print($subdomain); // prints "sub"