Yngvarr

Generation

generate functionSun, 19 Mar 2023

get tdl with domain

function get_tld($domain){ $domain_tld = null; if(preg_match("/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i", $domain, $matches)){ $domain_tld = $matches['domain']; } return $domain_tld; }

Questions about programming?Chat with your personal AI assistant