3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_tld() { $host = explode( ':', 'refer-wordpress-com-staging.go-vip.co' ); $domain_list = explode( '.', $host[0] ); return ( count( $domain_list ) > 1 ) ? implode( '.', array_slice( $domain_list, - 2 ) ) : $host[0]; } echo get_tld();

preferences:
62.28 ms | 402 KiB | 5 Q