Hello,
I think the best option is preg_replace but I might be wrong
If I have a variable with domain.com
How to I make a new variable with the extension of the domain ( com )
Thanks in advance,
James
Actually, [man]parse_url[/man] should pull the host, then some string functions could grab it.
$url = "http://www.domain.com/some/path/to/file.php"; $spl = parse_url($url); $tld = substr(strrchr($spl['host'], "."), 1); echo $tld;
ill try that now.
Thanks 🙂