answersLogoWhite

0


Best Answer

Using the $_SERVER superglobal array you can get the HTTP_HOST key which contains your domain, like so: $_SERVER["HTTP_HOST"]

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get the URL domain name in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you get the url in a php website?

Copy the URL with the .php, The .php is part of the page.


How are the url and domain name the same?

The URL or uniform resources language is a link, or web address that describes a specific location on the web. It normally starts with http:// or https://A domain name is part of the url, it is the name of the domain where the URL hosted. I.e. which server or domain hosts the web address.For example. The URL to this question is:How_are_the_url_and_domain_name_the_sameThe domain name is:wiki.answers.com


How can I have an URL?

Register a domain name.


What is the url of the website?

"URL" stands for "uniform resource locator." The URL for Google is http://www.google.com. In that example, "google.com" is the domain name. The URL is the entire web address that must be typed into the browser to locate a specific webpage. This often includes additional text after the domain name, separated from the domain name with a slash "/".


Is a URL suffix called a domain name?

False


What is the domain of a website mean?

A website domain is traditionally known as the name or URL of a website


Can you have a URL address with your name?

You can, if the domain name is not already used. But you have to rent it.


What part of the URL is the second level domain name?

A first level domain name is: www.firstlevel.com second level domain name is: www.second.firstlevel.com or: www.firstlevel.com/second


In the URL which part of the address is the pathname if the folder is the name of the website?

The pathname is the ending part of the URL. It is after the "slash" of the domain name.


A URL consists of a domain name sometimes the path?

Protocol


What is the unique address of a web webpages?

URL or domain name


What does info stand for in the end of a URL?

it is tha domain name