Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am shrikus on github.
* I am shrikus (https://keybase.io/shrikus) on keybase.
* I have a public key ASAsh24s6DXmzS6IeO6Vq4hzsM16FbYysaPzfIqqoSasRwo
To claim this, I am signing this object:
@shrikus
shrikus / get_domain_base.php
Last active March 15, 2018 15:56
PHP code to get the domain name without subdomains (includes the tld, and the special types from IANA). Don't have support for unicode domain names.
<?php
/**
* @param string $domain Pass $_SERVER['SERVER_NAME'] here
*
* @return string
*
* replacement for https://gist.github.com/pocesar/5366899
*/
function get_domain_base($domain) {