I am having a list of array of domains from which I want to get only the name of the domain so the list is something like this :
$domain_name = [
"domain",
"somedomain",
"mydomain",
"yourdomain"
];
And i will be using $_SERVER['HTTP_REFERER']
to catch a domain name. From which I just want to get the domain base name with any www. or .com/ .in/ .io/ .net / .org e.t.c or any tralling slash in the URL. Just want to know the basic domain name. Is there any way to do that in php?